settings for "unreachable" exit status
This commit is contained in:
parent
359d346c33
commit
fc953c1bdd
@ -17,6 +17,7 @@ fi
|
|||||||
|
|
||||||
HEALTHCHECK_URL=${HEALTHCHECK_URL:-http://127.0.0.1}
|
HEALTHCHECK_URL=${HEALTHCHECK_URL:-http://127.0.0.1}
|
||||||
HEALTHCHECK_ENABLE=${HEALTHCHECK_ENABLE:-false}
|
HEALTHCHECK_ENABLE=${HEALTHCHECK_ENABLE:-false}
|
||||||
|
FAIL_IF_TARGET_UNREACHABLE=${FAIL_IF_TARGET_UNREACHABLE:-true}
|
||||||
CURLOPTS=(-fsS -m 10 --retry 5)
|
CURLOPTS=(-fsS -m 10 --retry 5)
|
||||||
|
|
||||||
if [[ ! -d /run/btrbk ]] ; then
|
if [[ ! -d /run/btrbk ]] ; then
|
||||||
@ -57,7 +58,11 @@ if [[ "${SSH_OK}" = "" ]] ; then
|
|||||||
curl "${CURLOPTS[@]}" --data-binary "@${LOGFILE}" "${HEALTHCHECK_URL}/log"
|
curl "${CURLOPTS[@]}" --data-binary "@${LOGFILE}" "${HEALTHCHECK_URL}/log"
|
||||||
fi
|
fi
|
||||||
rm -f -- "${LOGFILE}"
|
rm -f -- "${LOGFILE}"
|
||||||
exit 1
|
if [[ "${FAIL_IF_TARGET_UNREACHABLE}" = "true" ]] ; then
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Start backup: $(date||true)" | tee -a "${LOGFILE}"
|
echo "Start backup: $(date||true)" | tee -a "${LOGFILE}"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
HEALTHCHECK_ENABLE=true
|
HEALTHCHECK_ENABLE=true
|
||||||
HEALTHCHECK_URL=https://my.selfhosted.healthcheck.com/ping/e48e4add-c17c-467c-9a91-7b245ad57fe8
|
HEALTHCHECK_URL=https://my.selfhosted.healthcheck.com/ping/e48e4add-c17c-467c-9a91-7b245ad57fe8
|
||||||
|
FAIL_IF_TARGET_UNREACHABLE=true
|
||||||
|
Loading…
Reference in New Issue
Block a user