1
0
Fork 0
mirror of https://github.com/yavook/kiwi-backup.git synced 2024-11-22 15:03:01 +00:00

move function to file top

This commit is contained in:
Jörn-Michael Miehe 2022-10-20 23:00:27 +02:00
parent 58cf8b79f5
commit 069287989f

View file

@ -6,19 +6,6 @@ this_dir="${this_script%/*}"
# files # files
duplicity_secrets_file="/root/duplicity_secrets" duplicity_secrets_file="/root/duplicity_secrets"
# load secrets file
if [ -f "${duplicity_secrets_file}" ]; then
# shellcheck disable=SC1090
. "${duplicity_secrets_file}"
fi
# handle more verbose "GPG_PASSPHRASE" env var
if [ -n "${GPG_PASSPHRASE}" ]; then
PASSPHRASE="${GPG_PASSPHRASE:-${PASSPHRASE}}"
export PASSPHRASE
unset GPG_PASSPHRASE
fi
run_webhook() { #url #message run_webhook() { #url #message
if [ -z "${WEBHOOK_URL}" ]; then if [ -z "${WEBHOOK_URL}" ]; then
return 1 return 1
@ -35,6 +22,19 @@ run_webhook() { #url #message
curl ${_rw_curl_args} "${_rw_webhook_url}" 1>/dev/null 2>/dev/null curl ${_rw_curl_args} "${_rw_webhook_url}" 1>/dev/null 2>/dev/null
} }
# load secrets file
if [ -f "${duplicity_secrets_file}" ]; then
# shellcheck disable=SC1090
. "${duplicity_secrets_file}"
fi
# handle more verbose "GPG_PASSPHRASE" env var
if [ -n "${GPG_PASSPHRASE}" ]; then
PASSPHRASE="${GPG_PASSPHRASE:-${PASSPHRASE}}"
export PASSPHRASE
unset GPG_PASSPHRASE
fi
# run start webhook # run start webhook
run_webhook "${WEBHOOK_URL}" "running task ${*}" run_webhook "${WEBHOOK_URL}" "running task ${*}"