mirror of
https://github.com/yavook/kiwi-backup.git
synced 2024-11-25 08:03:01 +00:00
Webhook support
This commit is contained in:
parent
6b136d0bae
commit
60869e4726
2 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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 $( \
|
||||
|
|
Loading…
Reference in a new issue