Browse Source

feat: add conditional printing of alert messages

This commit adds conditional statements to only print alert messages if the corresponding alerts are turned on. This improves the readability of the output by only displaying relevant information.

- Added conditionals for Discord, Email, Gotify, IFTTT, Pushbullet, Pushover, Rocketchat, Slack, and Telegram alerts
- Only prints alert messages if the corresponding alerts are turned on
feature/dst-changes
Daniel Gibbs 2 years ago
parent
commit
89ec3abc48
No known key found for this signature in database GPG Key ID: 2076B128385E8C55
  1. 20
      lgsm/modules/info_messages.sh

20
lgsm/modules/info_messages.sh

@ -543,25 +543,41 @@ fn_info_message_script() {
fi
# Discord alert
if [ "${discordalert}" == "on" ]; then
echo -e "${lightblue}Discord alert:\t${default}${discordalert}"
fi
# Email alert
if [ "${emailalert}" == "on" ]; then
echo -e "${lightblue}Email alert:\t${default}${emailalert}"
fi
# Gotify alert
if [ "${gotifyalert}" == "on" ]; then
echo -e "${lightblue}Gotify alert:\t${default}${gotifyalert}"
fi
# IFTTT alert
if [ "${iftttalert}" == "on" ]; then
echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}"
# Mailgun alert
echo -e "${lightblue}Mailgun (email) alert:\t${default}${mailgunalert}"
fi
# Pushbullet alert
if [ "${pushbulletalert}" == "on" ]; then
echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}"
fi
# Pushover alert
if [ "${pushoveralert}" == "on" ]; then
echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}"
fi
# Rocketchat alert
if [ "${rocketchatalert}" == "on" ]; then
echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}"
fi
# Slack alert
if [ "${slackalert}" == "on" ]; then
echo -e "${lightblue}Slack alert:\t${default}${slackalert}"
fi
# Telegram alert
if [ "${telegramalert}" == "on" ]; then
echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}"
fi
# Update on start
if [ -n "${updateonstart}" ]; then

Loading…
Cancel
Save