From 237baf82211eee6b30ca50a4e9eac02dc9906dbb Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 17 Oct 2023 21:19:16 +0100 Subject: [PATCH] fix: update Pushover alert message formatting The commit fixes the formatting of the Pushover alert message by removing unnecessary information and adding a conditional check for the presence of an alert URL. --- lgsm/modules/alert_pushover.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/alert_pushover.sh b/lgsm/modules/alert_pushover.sh index 77ec9df29..48009ab2c 100644 --- a/lgsm/modules/alert_pushover.sh +++ b/lgsm/modules/alert_pushover.sh @@ -22,7 +22,11 @@ else alertpriority="0" fi -pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alertemoji} ${alerttitle} ${alertemoji}" -F message=" Server name
${servername}

Message
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alerturl}" "https://api.pushover.net/1/messages.json" | grep errors) +if [ -z "${alerturl}" ]; then + pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}" "https://api.pushover.net/1/messages.json" | grep errors) +else + pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alerturl}" "https://api.pushover.net/1/messages.json" | grep errors) +fi if [ -n "${pushoversend}" ]; then fn_print_fail_nl "Sending Pushover alert: ${pushoversend}"