From 6803211e4846a08f453694da0e3937dc426e7fec 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 22:23:06 +0200 Subject: [PATCH] run_webhook function --- libexec/kiwi-backup/run_command | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libexec/kiwi-backup/run_command b/libexec/kiwi-backup/run_command index 0fc659b..304e45a 100755 --- a/libexec/kiwi-backup/run_command +++ b/libexec/kiwi-backup/run_command @@ -19,6 +19,19 @@ if [ -n "${GPG_PASSPHRASE}" ]; then unset GPG_PASSPHRASE fi +run_webhook() { + _rw_webhook_url="${1}" + _rw_message="${2}" + + _rw_curl_args="" + if [ "${WEBHOOK_INSECURE}" = "1" ]; then + _rw_curl_args="--insecure" + fi + + _rw_webhook_url="$(echo "${_rw_webhook_url}" | sed "s,%%MSG%%,,g" )" + curl ${_rw_curl_args} "${_rw_webhook_url}" 1>/dev/null 2>/dev/null +} + # run start webhook curl_args="" if [ "${WEBHOOK_INSECURE}" = "1" ]; then