From 505e9177b46f47cd08756cee07486de6fa8afe4b Mon Sep 17 00:00:00 2001 From: jamie Date: Wed, 7 Jul 2021 13:38:22 +0100 Subject: [PATCH] added gotify to alerts.sh --- lgsm/functions/alert.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 5fd999728..cbd11d95c 100755 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -141,6 +141,17 @@ elif [ -z "${email}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then fn_script_log_error "Email not set" fi +if [ "${gotifyalert}" == "on" ]&&[ -n "${gotifyalert}" ]; then + alert_gotify.sh +elif [ "${gotifyalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Gotify alerts not enabled" + fn_script_log_warn "Gotify alerts not enabled" +elif [ -z "${Gotifytoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Gotify token not set" + echo -e "* https://docs.linuxgsm.com/alerts/gotify" + fn_script_error "Gotify token not set" +fi + if [ "${iftttalert}" == "on" ]&&[ -n "${iftttalert}" ]; then alert_ifttt.sh elif [ "${iftttalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then