Daniel Gibbs
4 years ago
No known key found for this signature in database
GPG Key ID: 2EBB36015C6D78E2
5 changed files with
6 additions and
6 deletions
-
lgsm/functions/alert.sh
-
lgsm/functions/alert_discord.sh
-
lgsm/functions/alert_pushbullet.sh
-
lgsm/functions/alert_pushover.sh
-
lgsm/functions/alert_slack.sh
|
|
@ -165,8 +165,8 @@ else |
|
|
|
alertversion="Unknown" |
|
|
|
fi |
|
|
|
|
|
|
|
if [ "${postalert}" == "on" ]; then |
|
|
|
alertmoreinfo="More info" |
|
|
|
if [ "${postalert}" != "on" ]; then |
|
|
|
alertmoreinfourl="not enabled" |
|
|
|
fi |
|
|
|
|
|
|
|
# Images |
|
|
|
|
|
@ -59,7 +59,7 @@ json=$(cat <<EOF |
|
|
|
"value": "${alerttriggermessage}" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"name": "${alertmoreinfo}", |
|
|
|
"name": "More Info", |
|
|
|
"value": "${alertmoreinfourl}" |
|
|
|
} |
|
|
|
], |
|
|
|
|
|
@ -12,7 +12,7 @@ json=$(cat <<EOF |
|
|
|
"channel_tag": "${channeltag}", |
|
|
|
"type": "note", |
|
|
|
"title": "${alertemoji} ${alerttitle} ${alertemoji}", |
|
|
|
"body": "Server name\n${servername}\n\nTrigger Message\n${alerttriggermessage}\n\nGame\n${gamename}\n\nCurrent Players\n${alertplayers}\n\nMap\n${alertmap}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nVersion\n${alertversion}\n\n${alertmoreinfo}\n${alertmoreinfourl}" |
|
|
|
"body": "Server name\n${servername}\n\nTrigger Message\n${alerttriggermessage}\n\nGame\n${gamename}\n\nCurrent Players\n${alertplayers}\n\nMap\n${alertmap}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nVersion\n${alertversion}\n\nMore Info\n${alertmoreinfourl}" |
|
|
|
} |
|
|
|
EOF |
|
|
|
) |
|
|
|
|
|
@ -22,7 +22,7 @@ else |
|
|
|
alertpriority="0" |
|
|
|
fi |
|
|
|
|
|
|
|
pushoversend=$(curl --connect-timeout 10 -sSL -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alertemoji} ${alerttitle} ${alertemoji}" -F message=" <b>Server name</b><br>${servername}<br><br><b>Trigger Message</b><br>${alerttriggermessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Current Players</b><br>${alertplayers}<br><br><b>Map</b><br>${alertmap}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>Version</b><br>${alertversion}<br><br><b>${alertmoreinfo}</b><br>${alertmoreinfourl}" "https://api.pushover.net/1/messages.json" | grep errors) |
|
|
|
pushoversend=$(curl --connect-timeout 10 -sSL -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alertemoji} ${alerttitle} ${alertemoji}" -F message=" <b>Server name</b><br>${servername}<br><br><b>Trigger Message</b><br>${alerttriggermessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Current Players</b><br>${alertplayers}<br><br><b>Map</b><br>${alertmap}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>Version</b><br>${alertversion}<br><br><b>More Info</b><br>${alertmoreinfourl}" "https://api.pushover.net/1/messages.json" | grep errors) |
|
|
|
|
|
|
|
if [ -n "${pushoversend}" ]; then |
|
|
|
fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" |
|
|
|
|
|
@ -133,7 +133,7 @@ json=$(cat <<EOF |
|
|
|
"type": "section", |
|
|
|
"text": { |
|
|
|
"type": "mrkdwn", |
|
|
|
"text": "*${alertmoreinfo}*\n${alertmoreinfourl}" |
|
|
|
"text": "*More info*\n${alertmoreinfourl}" |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|