Skip to content

Commit

Permalink
feat: add conditional printing of alert messages
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dgibbs64 committed Oct 1, 2023
1 parent eb5c833 commit 89ec3ab
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions lgsm/modules/info_messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -543,25 +543,41 @@ fn_info_message_script() {
fi

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

# Update on start
if [ -n "${updateonstart}" ]; then
Expand Down

0 comments on commit 89ec3ab

Please sign in to comment.