diff --git a/README.md b/README.md index db8015f..344c075 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,12 @@ backup: # Additional options for "duplicity remove-all-inc-of-but-n-full" command OPTIONS_RMINCR: "" + + # Webhook to be pinged on action (use "%%MSG%%" as a placeholder for a message) + WEBHOOK_URL: "" + + # Allow self-signed certificates on webhook target + WEBHOOK_INSECURE: "0" ``` ## Encryption diff --git a/libexec/kiwi-backup/run_command b/libexec/kiwi-backup/run_command index 4025b30..8d974de 100755 --- a/libexec/kiwi-backup/run_command +++ b/libexec/kiwi-backup/run_command @@ -19,6 +19,17 @@ if [ -n "${GPG_PASSPHRASE}" ]; then unset GPG_PASSPHRASE fi +# run webhook +if [ -n "${WEBHOOK_URL}" ]; then + wget_args="" + if [ "${WEBHOOK_INSECURE}" = "1" ]; then + wget_args="--no-check-certificate" + fi + + WEBHOOK_URL="$(echo "${WEBHOOK_URL}" | sed "s,%%MSG%%,running task ${*},g" )" + wget -O /dev/null ${wget_args} "${WEBHOOK_URL}" +fi + # hand over set -ex exec $( \