From 069287989f0dc86f90c3a321d4f86ef7e2348b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Thu, 20 Oct 2022 23:00:27 +0200 Subject: [PATCH] move function to file top --- libexec/kiwi-backup/run_command | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) 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 ${*}"