Daniel Gibbs 5 лет назад
Родитель
Сommit
7c2a7641d8
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      lgsm/functions/alert.sh

+ 11 - 0
lgsm/functions/alert.sh

@@ -176,6 +176,17 @@ elif [ -z "${pushovertoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_script_error "Pushover token not set"
 fi
 
+if [ "${sendgridalert}" == "on" ]&&[ -n "${sendgridalert}" ]; then
+	alert_sendgrid.sh
+elif [ "${sendgridalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
+	fn_print_warn_nl "SendGrid alerts not enabled"
+	fn_script_log_warn "SendGrid alerts not enabled"
+elif [ -z "${sendgridtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
+	fn_print_error_nl "SendGrid token not set"
+	echo -e "* https://docs.linuxgsm.com/alerts/sendgrid"
+	fn_script_error "SendGrid token not set"
+fi
+
 if [ "${telegramalert}" == "on" ]&&[ -n "${telegramtoken}" ]; then
 	alert_telegram.sh
 elif [ "${telegramalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then