mirror of
https://github.com/yavook/kiwi-backup.git
synced 2024-11-22 06:53:00 +00:00
move function to file top
This commit is contained in:
parent
58cf8b79f5
commit
069287989f
1 changed files with 13 additions and 13 deletions
|
@ -6,19 +6,6 @@ this_dir="${this_script%/*}"
|
|||
# files
|
||||
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
|
||||
if [ -z "${WEBHOOK_URL}" ]; then
|
||||
return 1
|
||||
|
@ -35,6 +22,19 @@ run_webhook() { #url #message
|
|||
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_webhook "${WEBHOOK_URL}" "running task ${*}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue