Browse Source

update pushbullet and push over

feature/alerts-refactor
Daniel Gibbs 4 years ago
parent
commit
86f83281af
No known key found for this signature in database GPG Key ID: 2EBB36015C6D78E2
  1. 2
      lgsm/functions/alert_pushbullet.sh
  2. 2
      lgsm/functions/alert_pushover.sh

2
lgsm/functions/alert_pushbullet.sh

@ -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\n${alertplayerstitle}\n${alertplayers}\n\nMap\n${alertmap}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}"
"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${alerturl}"
}
EOF
)

2
lgsm/functions/alert_pushover.sh

@ -22,7 +22,7 @@ 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=" <b>Server name</b><br>${servername}<br><br><b>Message</b><br>${alerttriggermessage}<br><br><b>Game</b><br>${gamename}<br><br><b>${alertplayerstitle}</b><br>${alertplayers}<br><br><b>Map</b><br>${alertmap}<br><br><b>Server IP</b><br><a href='https://www.gametracker.com/server_info/${alertip}:${port}'>${alertip}:${port}</a><br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>More info</b><br><a href='${alerturl}'>${alerturl}</a>" "https://api.pushover.net/1/messages.json" | grep errors)
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<br>${servername}<br><br>Trigger Message<br>${alerttriggermessage}<br><br>Game<br>${gamename}<br><br>Current Players<br>${alertplayers}<br><br>Map<br>${alertmap}<br><br>Server IP<br>${alertip}:${port}<br><br>Hostname<br>${HOSTNAME}<br><br>Version<br>${alertversion}<br><br>More info<br>${alerturl}" "https://api.pushover.net/1/messages.json" | grep errors)
if [ -n "${pushoversend}" ]; then
fn_print_fail_nl "Sending Pushover alert: ${pushoversend}"

Loading…
Cancel
Save