Skip to content
Snippets Groups Projects
Commit d06b89cd authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Fix missing server variable

parent 7d33b742
No related branches found
No related tags found
No related merge requests found
......@@ -207,20 +207,20 @@ dav_delete() {
log_info "curl: EXISTS ${1}?"
# checks if the directory exists before trying to remove it (use --head)
local code=$(curl --location --silent --fail --write-out "%{http_code}" --head --user "${DOCUSER}:${DOCPASS}" "$1")
local code=$(curl --location --silent --fail --write-out "%{http_code}" --head --user "${DOCUSER}:${DOCPASS}" "${DOCSERVER}/$1")
if [[ ${code} == *404 ]]; then
log_info "Directory $1 does not exist. Skipping deletion"
return 0
fi
log_info "curl: DELETE ${1}..."
code=$(curl --location --silent --fail --write-out "%{http_code}" --user "${DOCUSER}:${DOCPASS}" -X DELETE "$1")
code=$(curl --location --silent --fail --write-out "%{http_code}" --user "${DOCUSER}:${DOCPASS}" -X DELETE "${DOCSERVER}/$1")
if [[ ${code} == *204 || ${code} == *201 ]]; then
log_info "Successfully deleted ${1} with curl"
else
log_error "Curl command finished with an error condition (code=${code}):"
curl --location --silent --user "${DOCUSER}:${DOCPASS}" -X DELETE "$1"
curl --location --silent --user "${DOCUSER}:${DOCPASS}" -X DELETE "${DOCSERVER}/$1"
exit "${code}"
fi
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment