From f26101c816e01adcca4b2844fff2006415dfb2ff Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Oct 2021 10:42:44 +0100 Subject: [PATCH] more info --- lgsm/functions/alert.sh | 16 +++++----- lgsm/functions/alert_discord.sh | 8 +++-- lgsm/functions/alert_gotify.sh | 2 +- lgsm/functions/alert_ifttt.sh | 2 +- lgsm/functions/alert_pushbullet.sh | 2 +- lgsm/functions/alert_pushover.sh | 2 +- lgsm/functions/alert_rocketchat.sh | 2 +- lgsm/functions/alert_slack.sh | 50 ++++++++++++++++++++++++------ lgsm/functions/alert_telegram.sh | 2 +- 9 files changed, 61 insertions(+), 25 deletions(-) diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 3ad62d89a..1291ca947 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -35,7 +35,6 @@ fn_alert_test(){ alerttitle="Alert - ${selfname} - Test" alertemoji="๐Ÿšง" alertsound="1" - alerturl="not enabled" alerttriggermessage="Testing LinuxGSM Alert. No action to be taken." # Green alertcolourhex="#cdcd00" @@ -47,7 +46,6 @@ fn_alert_restart(){ alerttitle="Alert - ${selfname} - Restarted" alertemoji="๐Ÿšจ" alertsound="2" - alerturl="not enabled" alerttriggermessage="${selfname} is not running. Game Server has been restarted." # Red alertcolourhex="#cd0000" @@ -59,7 +57,6 @@ fn_alert_restart_query(){ alerttitle="Alert - ${selfname} - Restarted" alertemoji="๐Ÿšจ" alertsound="2" - alerturl="not enabled" alerttriggermessage="Unable to query ${selfname}. Game server has been restarted." # Red alertcolourhex="#cd0000" @@ -71,7 +68,6 @@ fn_alert_update(){ alerttitle="Alert - ${selfname} - Updated" alertemoji="๐ŸŽ‰" alertsound="1" - alerturl="not enabled" alerttriggermessage="${selfname} has received an update." # Green alertcolourhex="#00cd00" @@ -83,7 +79,6 @@ fn_alert_check_update(){ alerttitle="Alert - ${selfname} - Update available" alertemoji="๐Ÿ’ฟ" alertsound="1" - alerturl="not enabled" alerttriggermessage="Update available for ${selfname}." # Blue alertcolourhex="#1e90ff" @@ -95,7 +90,6 @@ fn_alert_permissions(){ alerttitle="Alert - ${selfname}: Permissions error" alertemoji="โ—" alertsound="2" - alerturl="not enabled" alerttriggermessage="${selfname} has permissions issues." # Red alertcolourhex="#cd0000" @@ -107,7 +101,6 @@ fn_alert_config(){ alerttitle="Alert - ${selfname} - New _default.cfg" alertemoji="๐Ÿ“„" alertsound="1" - alerturl="not enabled" alerttriggermessage="${selfname} has received a new _default.cfg. Check file for changes." # Blue alertcolourhex="#1e90ff" @@ -119,7 +112,6 @@ fn_alert_wipe(){ alerttitle="Alert - ${selfname} - Wiped" alertemoji="๐Ÿงน" alertsound="1" - alerturl="not enabled" alerttriggermessage="${selfname} as been wiped." # Green alertcolourhex="#00cd00" @@ -173,16 +165,24 @@ else alertversion="Unknown" fi +if [ "${postalert}" == "on" ]; then + alertmoreinfo="More info" +fi + # Images mapimagestatus="$(curl -o /dev/null -s -w "%{http_code}\n" https://raw.githubusercontent.com/${githubuser}/game-server-map-images/main/${shortname}/${alertmap}.jpg)" if [ -n "${gdmap}" ]&&[ "${mapimagestatus}" == "200" ]; then alertimage="https://raw.githubusercontent.com/${githubuser}/game-server-map-images/main/${shortname}/${gdmap}.jpg" +alertimagealt="${gdmap}" elif [ -n "${appid}" ]; then alertimage="https://cdn.cloudflare.steamstatic.com/steam/apps/${gameappid}/header.jpg" + alertimagealt="${gamename} header" else alertimage="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/gameheaders/${shortname}-header.jpg" + alertimagealt="${gamename} header" fi alerticon="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/gameicons/${shortname}-icon.png" +alerticonalt="${gamename} icon" if [ "${alert}" == "permissions" ]; then fn_alert_permissions diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index e5995084e..62098c9be 100755 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -41,7 +41,7 @@ json=$(cat <${servername}

Trigger Message
${alerttriggermessage}

Game
${gamename}

${alertplayerstitle}
${alertplayers}

Map
${alertmap}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alerturl}" + "value3": "Server name
${servername}

Trigger Message
${alerttriggermessage}

Game
${gamename}

${alertplayerstitle}
${alertplayers}

Map
${alertmap}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alertmoreinfourl}" } EOF ) diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh index 0ed6ee92f..41f007fb5 100755 --- a/lgsm/functions/alert_pushbullet.sh +++ b/lgsm/functions/alert_pushbullet.sh @@ -12,7 +12,7 @@ json=$(cat <${alertemoji} ${alerttitle} ${alertemoji}\n\nServer 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}", + "text": "${alertemoji} ${alerttitle} ${alertemoji}\n\nServer 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}", "disable_web_page_preview": "yes" } EOF