mirror of
https://github.com/yavook/kiwi-backup.git
synced 2024-11-22 06:53:00 +00:00
Merge tag 'v0.11' into develop
Webhook Support
This commit is contained in:
commit
1f9788da9f
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