diff --git a/libexec/kiwi-backup/run_command b/libexec/kiwi-backup/run_command index 78b5c21..0586850 100755 --- a/libexec/kiwi-backup/run_command +++ b/libexec/kiwi-backup/run_command @@ -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 ${*}"