From 91c14fd6f25a5acd5204a6581e32ad46eb452a96 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 16 Oct 2021 21:46:05 +0100 Subject: [PATCH 01/14] update --- lgsm/functions/alert.sh | 16 ++++++++-------- lgsm/functions/alert_slack.sh | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) mode change 100755 => 100644 lgsm/functions/alert_slack.sh diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index f73cd513d..f1c7b22ed 100755 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -27,7 +27,7 @@ fn_alert_log(){ fn_alert_test(){ fn_script_log_info "Sending test alert" - alerttitle="Alert - ${selfname} - Test" + alerttitle="${selfname} - Test" alertemoji="๐Ÿšง" alertsound="1" alerturl="not enabled" @@ -39,7 +39,7 @@ fn_alert_test(){ fn_alert_restart(){ fn_script_log_info "Sending alert: Restarted: ${selfname}, ${executable} is not running" - alerttitle="Alert - ${selfname} - Restarted" + alerttitle="${selfname} - Restarted" alertemoji="๐Ÿšจ" alertsound="2" alerturl="not enabled" @@ -51,7 +51,7 @@ fn_alert_restart(){ fn_alert_restart_query(){ fn_script_log_info "Sending alert: Restarted: ${selfname}" - alerttitle="Alert - ${selfname} - Restarted" + alerttitle="${selfname} - Restarted" alertemoji="๐Ÿšจ" alertsound="2" alerturl="not enabled" @@ -63,7 +63,7 @@ fn_alert_restart_query(){ fn_alert_update(){ fn_script_log_info "Sending alert: Updated: ${selfname}" - alerttitle="Alert - ${selfname} - Updated" + alerttitle="${selfname} - Updated" alertemoji="๐ŸŽฎ" alertsound="1" alerturl="not enabled" @@ -75,7 +75,7 @@ fn_alert_update(){ fn_alert_check_update(){ fn_script_log_info "Sending alert: Update available" - alerttitle="Alert - ${selfname} - Update available" + alerttitle="${selfname} - Update available" alertemoji="๐ŸŽฎ" alertsound="1" alerturl="not enabled" @@ -87,7 +87,7 @@ fn_alert_check_update(){ fn_alert_permissions(){ fn_script_log_info "Sending alert: Permissions error" - alerttitle="Alert - ${selfname}: Permissions error" + alerttitle="${selfname}: Permissions error" alertemoji="โ—" alertsound="2" alerturl="not enabled" @@ -99,7 +99,7 @@ fn_alert_permissions(){ fn_alert_config(){ fn_script_log_info "Sending alert: New _default.cfg" - alerttitle="Alert - ${selfname} - New _default.cfg" + alerttitle="${selfname} - New _default.cfg" alertemoji="๐Ÿ“„" alertsound="1" alerturl="not enabled" @@ -111,7 +111,7 @@ fn_alert_config(){ fn_alert_wipe(){ fn_script_log_info "Sending alert: Wiped: ${selfname} wiped" - alerttitle="Alert - ${selfname} - Wiped" + alerttitle="${selfname} - Wiped" alertemoji="๐Ÿ’ฟ" alertsound="1" alerturl="not enabled" diff --git a/lgsm/functions/alert_slack.sh b/lgsm/functions/alert_slack.sh old mode 100755 new mode 100644 index e0a185c53..d9aaa9543 --- a/lgsm/functions/alert_slack.sh +++ b/lgsm/functions/alert_slack.sh @@ -36,7 +36,7 @@ json=$(cat < Date: Sat, 16 Oct 2021 21:47:39 +0100 Subject: [PATCH 02/14] Auto stash before merge of "feature/alerts-refactor" and "origin/feature/alerts-refactor" --- lgsm/functions/alert.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 lgsm/functions/alert.sh diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh old mode 100755 new mode 100644 From b3060264fa294e0556278270b2a858e821c0b47d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 16 Oct 2021 22:24:22 +0100 Subject: [PATCH 03/14] email --- lgsm/functions/alert.sh | 22 +++++++++++----------- lgsm/functions/alert_email.sh | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index f1c7b22ed..25949d6df 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -27,7 +27,7 @@ fn_alert_log(){ fn_alert_test(){ fn_script_log_info "Sending test alert" - alerttitle="${selfname} - Test" + alerttitle="Alert - ${selfname} - Test" alertemoji="๐Ÿšง" alertsound="1" alerturl="not enabled" @@ -39,7 +39,7 @@ fn_alert_test(){ fn_alert_restart(){ fn_script_log_info "Sending alert: Restarted: ${selfname}, ${executable} is not running" - alerttitle="${selfname} - Restarted" + alerttitle="Alert - ${selfname} - Restarted" alertemoji="๐Ÿšจ" alertsound="2" alerturl="not enabled" @@ -51,7 +51,7 @@ fn_alert_restart(){ fn_alert_restart_query(){ fn_script_log_info "Sending alert: Restarted: ${selfname}" - alerttitle="${selfname} - Restarted" + alerttitle="Alert - ${selfname} - Restarted" alertemoji="๐Ÿšจ" alertsound="2" alerturl="not enabled" @@ -63,8 +63,8 @@ fn_alert_restart_query(){ fn_alert_update(){ fn_script_log_info "Sending alert: Updated: ${selfname}" - alerttitle="${selfname} - Updated" - alertemoji="๐ŸŽฎ" + alerttitle="Alert - ${selfname} - Updated" + alertemoji="๐ŸŽ‰" alertsound="1" alerturl="not enabled" alertmessage="${selfname} has received an update" @@ -75,8 +75,8 @@ fn_alert_update(){ fn_alert_check_update(){ fn_script_log_info "Sending alert: Update available" - alerttitle="${selfname} - Update available" - alertemoji="๐ŸŽฎ" + alerttitle="Alert - ${selfname} - Update available" + alertemoji="๐Ÿ’ฟ" alertsound="1" alerturl="not enabled" alertmessage="Update availablefor ${selfname}" @@ -87,7 +87,7 @@ fn_alert_check_update(){ fn_alert_permissions(){ fn_script_log_info "Sending alert: Permissions error" - alerttitle="${selfname}: Permissions error" + alerttitle="Alert - ${selfname}: Permissions error" alertemoji="โ—" alertsound="2" alerturl="not enabled" @@ -99,7 +99,7 @@ fn_alert_permissions(){ fn_alert_config(){ fn_script_log_info "Sending alert: New _default.cfg" - alerttitle="${selfname} - New _default.cfg" + alerttitle="Alert - ${selfname} - New _default.cfg" alertemoji="๐Ÿ“„" alertsound="1" alerturl="not enabled" @@ -111,8 +111,8 @@ fn_alert_config(){ fn_alert_wipe(){ fn_script_log_info "Sending alert: Wiped: ${selfname} wiped" - alerttitle="${selfname} - Wiped" - alertemoji="๐Ÿ’ฟ" + alerttitle="Alert - ${selfname} - Wiped" + alertemoji="๐Ÿงน" alertsound="1" alerturl="not enabled" alertmessage="${selfname} as been wiped." diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index a4e2ae716..2e6bec0c8 100755 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -11,7 +11,7 @@ fn_print_dots "Sending Email alert: ${email}" fn_sleep_time if [ -n "${emailfrom}" ]; then - mail -s "${alerttitle}" -r "${emailfrom}" "${email}" < "${alertlog}" + mail -s "${alertemoji} ${alerttitle} ${alertemoji}" -r "${emailfrom}" "${email}" < "${alertlog}" else mail -s "${alerttitle}" "${email}" < "${alertlog}" fi From b56df841c5c80aa166988d2bc2cf55fa729c6b95 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 16 Oct 2021 22:27:37 +0100 Subject: [PATCH 04/14] emoji email --- lgsm/functions/alert_email.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index 2e6bec0c8..f5faa1a9d 100755 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -13,7 +13,7 @@ fn_sleep_time if [ -n "${emailfrom}" ]; then mail -s "${alertemoji} ${alerttitle} ${alertemoji}" -r "${emailfrom}" "${email}" < "${alertlog}" else - mail -s "${alerttitle}" "${email}" < "${alertlog}" + mail -s "${alertemoji} ${alerttitle} ${alertemoji}" "${email}" < "${alertlog}" fi exitcode=$? if [ "${exitcode}" == "0" ]; then From ac90e1da1ba6d5c54a9ef46b9a449d465ad24803 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 16 Oct 2021 22:43:36 +0100 Subject: [PATCH 05/14] add more info to email --- lgsm/functions/alert.sh | 5 +++++ lgsm/functions/info_messages.sh | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 25949d6df..8810b5329 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -21,6 +21,11 @@ fn_alert_log(){ fn_info_message_server_resource fn_info_message_gameserver_resource fn_info_message_gameserver + fn_info_message_script + fn_info_message_backup + fn_info_message_commandlineparms + fn_info_message_ports_edit + fn_info_message_ports fn_info_logs } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${alertlog}" > /dev/null 2>&1 } diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index f3a8342a6..1eb61571e 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -62,17 +62,17 @@ fn_info_message_head(){ echo -e "Message" echo -e "${alertmessage}" echo -e "" - echo -e "Game" - echo -e "${gamename}" - echo -e "" echo -e "Server name" echo -e "${servername}" echo -e "" + echo -e "Game" + echo -e "${gamename}" + echo -e "" echo -e "Hostname" echo -e "${HOSTNAME}" echo -e "" echo -e "Server IP" - echo -e "${ip}:${port}" + echo -e "${alertip}:${port}" } fn_info_message_distro(){ From 7a985ea4e6d34834160c688ab629ef6fc5235fbb Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 16 Oct 2021 23:09:23 +0100 Subject: [PATCH 06/14] email summary has same info as other alerts --- lgsm/functions/info_messages.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 1eb61571e..0b679354d 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -59,20 +59,26 @@ fn_info_message_head(){ echo -e "" echo -e "${lightyellow}Alert Summary${default}" fn_messages_separator - echo -e "Message" - echo -e "${alertmessage}" - echo -e "" echo -e "Server name" echo -e "${servername}" echo -e "" echo -e "Game" echo -e "${gamename}" echo -e "" - echo -e "Hostname" - echo -e "${HOSTNAME}" + echo -e "Current Players" + echo -e "${alertplayers}" + echo -e "" + echo -e "Map" + echo -e "${alertmap}" echo -e "" echo -e "Server IP" echo -e "${alertip}:${port}" + echo -e "" + echo -e "Hostname" + echo -e "${HOSTNAME}" + echo -e "" + echo -e "Version" + echo -e "${alertversion}" } fn_info_message_distro(){ From c12be179b55755db9629ebda10d90f501aebc4d1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 16 Oct 2021 23:25:49 +0100 Subject: [PATCH 07/14] trigger message --- lgsm/functions/alert.sh | 16 ++++++++-------- lgsm/functions/alert_discord.sh | 4 ++-- 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 | 2 +- lgsm/functions/info_messages.sh | 2 ++ 9 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 8810b5329..3ad62d89a 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -36,7 +36,7 @@ fn_alert_test(){ alertemoji="๐Ÿšง" alertsound="1" alerturl="not enabled" - alertmessage="Testing LinuxGSM Alert. No action to be taken." + alerttriggermessage="Testing LinuxGSM Alert. No action to be taken." # Green alertcolourhex="#cdcd00" alertcolourdec="13487360" @@ -48,7 +48,7 @@ fn_alert_restart(){ alertemoji="๐Ÿšจ" alertsound="2" alerturl="not enabled" - alertmessage="${selfname} is not running. Game Server has been restarted." + alerttriggermessage="${selfname} is not running. Game Server has been restarted." # Red alertcolourhex="#cd0000" alertcolourdec="13434880" @@ -60,7 +60,7 @@ fn_alert_restart_query(){ alertemoji="๐Ÿšจ" alertsound="2" alerturl="not enabled" - alertmessage="Unable to query ${selfname}. Game server has been restarted" + alerttriggermessage="Unable to query ${selfname}. Game server has been restarted." # Red alertcolourhex="#cd0000" alertcolourdec="13434880" @@ -72,7 +72,7 @@ fn_alert_update(){ alertemoji="๐ŸŽ‰" alertsound="1" alerturl="not enabled" - alertmessage="${selfname} has received an update" + alerttriggermessage="${selfname} has received an update." # Green alertcolourhex="#00cd00" alertcolourdec="52480" @@ -84,7 +84,7 @@ fn_alert_check_update(){ alertemoji="๐Ÿ’ฟ" alertsound="1" alerturl="not enabled" - alertmessage="Update availablefor ${selfname}" + alerttriggermessage="Update available for ${selfname}." # Blue alertcolourhex="#1e90ff" alertcolourdec="2003199" @@ -96,7 +96,7 @@ fn_alert_permissions(){ alertemoji="โ—" alertsound="2" alerturl="not enabled" - alertmessage="${selfname} has permissions issues" + alerttriggermessage="${selfname} has permissions issues." # Red alertcolourhex="#cd0000" alertcolourdec="13434880" @@ -108,7 +108,7 @@ fn_alert_config(){ alertemoji="๐Ÿ“„" alertsound="1" alerturl="not enabled" - alertmessage="${selfname} has received a new _default.cfg. Check file for changes." + alerttriggermessage="${selfname} has received a new _default.cfg. Check file for changes." # Blue alertcolourhex="#1e90ff" alertcolourdec="2003199" @@ -120,7 +120,7 @@ fn_alert_wipe(){ alertemoji="๐Ÿงน" alertsound="1" alerturl="not enabled" - alertmessage="${selfname} as been wiped." + alerttriggermessage="${selfname} as been wiped." # Green alertcolourhex="#00cd00" alertcolourdec="52480" diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index dfb1d46ed..69cde964c 100755 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -55,8 +55,8 @@ json=$(cat <${servername}

Message
${alertmessage}

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
${alerturl}" } EOF ) diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh index cea5f85d1..acb10e608 100755 --- a/lgsm/functions/alert_pushbullet.sh +++ b/lgsm/functions/alert_pushbullet.sh @@ -12,7 +12,7 @@ json=$(cat < Date: Sun, 17 Oct 2021 00:08:51 +0100 Subject: [PATCH 08/14] update gotify --- lgsm/functions/alert_discord.sh | 2 +- lgsm/functions/alert_gotify.sh | 2 +- lgsm/functions/info_messages.sh | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index 69cde964c..e5995084e 100755 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -56,7 +56,7 @@ json=$(cat < Date: Sun, 17 Oct 2021 00:14:27 +0100 Subject: [PATCH 09/14] update pushbullet and push over --- lgsm/functions/alert_pushbullet.sh | 2 +- lgsm/functions/alert_pushover.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh index acb10e608..8b1eb8607 100755 --- a/lgsm/functions/alert_pushbullet.sh +++ b/lgsm/functions/alert_pushbullet.sh @@ -12,7 +12,7 @@ json=$(cat < Date: Sun, 17 Oct 2021 00:24:42 +0100 Subject: [PATCH 10/14] pushover telegram --- lgsm/functions/alert_pushover.sh | 2 +- lgsm/functions/alert_telegram.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/alert_pushover.sh b/lgsm/functions/alert_pushover.sh index 0e886aa4c..12dd12da3 100755 --- a/lgsm/functions/alert_pushover.sh +++ b/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="Server name
${servername}

Trigger Message
${alerttriggermessage}

Game
${gamename}

Current Players
${alertplayers}

Map
${alertmap}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Version
${alertversion}

More info
${alerturl}" "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
${servername}

Trigger Message
${alerttriggermessage}

Game
${gamename}

Current Players
${alertplayers}

Map
${alertmap}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Version
${alertversion}

More info
${alerturl}" "https://api.pushover.net/1/messages.json" | grep errors) if [ -n "${pushoversend}" ]; then fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" diff --git a/lgsm/functions/alert_telegram.sh b/lgsm/functions/alert_telegram.sh index 7da6a9f0c..ace8eac78 100755 --- a/lgsm/functions/alert_telegram.sh +++ b/lgsm/functions/alert_telegram.sh @@ -11,7 +11,7 @@ json=$(cat <${alertemoji} ${alertsubject} ${alertemoji}\n\nServer name\n${servername}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}", + "text": "${alertemoji} ${alertsubject} ${alertemoji}\

Server name
${servername}

Trigger Message
${alerttriggermessage}

Game
${gamename}

Current Players
${alertplayers}

Map
${alertmap}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Version
${alertversion}

More info
${alerturl}", "disable_web_page_preview": "yes" } EOF From 867aeb51542fc3f9adb4ab248dee330fc201b264 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Oct 2021 00:36:15 +0100 Subject: [PATCH 11/14] telegram cr --- lgsm/functions/alert_telegram.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/alert_telegram.sh b/lgsm/functions/alert_telegram.sh index ace8eac78..e7948ac40 100755 --- a/lgsm/functions/alert_telegram.sh +++ b/lgsm/functions/alert_telegram.sh @@ -11,7 +11,7 @@ json=$(cat <${alertemoji} ${alertsubject} ${alertemoji}\

Server name
${servername}

Trigger Message
${alerttriggermessage}

Game
${gamename}

Current Players
${alertplayers}

Map
${alertmap}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Version
${alertversion}

More info
${alerturl}", + "text": "${alertemoji} ${alertsubject} ${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}", "disable_web_page_preview": "yes" } EOF From 26c5cab3df4d3a15b64a69cc40d5daad30d52041 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Oct 2021 01:00:46 +0100 Subject: [PATCH 12/14] space --- lgsm/functions/alert_gotify.sh | 1 - lgsm/functions/alert_pushbullet.sh | 2 +- lgsm/functions/alert_pushover.sh | 2 +- lgsm/functions/alert_rocketchat.sh | 1 - lgsm/functions/alert_slack.sh | 1 - 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/alert_gotify.sh b/lgsm/functions/alert_gotify.sh index 8c23a610a..5f77ef5d6 100644 --- a/lgsm/functions/alert_gotify.sh +++ b/lgsm/functions/alert_gotify.sh @@ -17,7 +17,6 @@ EOF ) fn_print_dots "Sending Gotify alert" - gotifysend=$(curl --connect-timeout 10 -sSL "${gotifywebhook}/message"?token="${gotifytoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)") if [ -n "${gotifysend}" ]; then diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh index 8b1eb8607..0ed6ee92f 100755 --- a/lgsm/functions/alert_pushbullet.sh +++ b/lgsm/functions/alert_pushbullet.sh @@ -18,7 +18,7 @@ EOF ) fn_print_dots "Sending Pushbullet alert" -pushbulletsend=$(curl --connect-timeout 10 -sSL -u """${pushbullettoken}"":" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code") +pushbulletsend=$(curl --connect-timeout 10 -sSL -H "Access-Token: ${pushbullettoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code") if [ -n "${pushbulletsend}" ]; then fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}" diff --git a/lgsm/functions/alert_pushover.sh b/lgsm/functions/alert_pushover.sh index 12dd12da3..8814060c4 100755 --- a/lgsm/functions/alert_pushover.sh +++ b/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="Server name
${servername}

Trigger Message
${alerttriggermessage}

Game
${gamename}

Current Players
${alertplayers}

Map
${alertmap}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Version
${alertversion}

More info
${alerturl}" "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="Server name
${servername}

Trigger Message
${alerttriggermessage}

Game
${gamename}

Current Players
${alertplayers}

Map
${alertmap}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Version
${alertversion}

More info
${alerturl}" "https://api.pushover.net/1/messages.json" | grep errors) if [ -n "${pushoversend}" ]; then fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" diff --git a/lgsm/functions/alert_rocketchat.sh b/lgsm/functions/alert_rocketchat.sh index f459cf3a4..1df5a47bb 100755 --- a/lgsm/functions/alert_rocketchat.sh +++ b/lgsm/functions/alert_rocketchat.sh @@ -37,7 +37,6 @@ EOF ) fn_print_dots "Sending Rocketchat alert" - rocketchatsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${rocketchatwebhook}") if [ -n "${rocketchatsend}" ]; then diff --git a/lgsm/functions/alert_slack.sh b/lgsm/functions/alert_slack.sh index 08225c79d..b2003ee93 100644 --- a/lgsm/functions/alert_slack.sh +++ b/lgsm/functions/alert_slack.sh @@ -124,7 +124,6 @@ EOF ) fn_print_dots "Sending Slack alert" - slacksend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${slackwebhook}") if [ "${slacksend}" == "ok" ]; then From f0f5ccd631ecca1a0527846ccbdeb93843744c36 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Oct 2021 01:09:37 +0100 Subject: [PATCH 13/14] alerttitle --- lgsm/functions/alert_telegram.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/alert_telegram.sh b/lgsm/functions/alert_telegram.sh index e7948ac40..4ded71b57 100755 --- a/lgsm/functions/alert_telegram.sh +++ b/lgsm/functions/alert_telegram.sh @@ -11,7 +11,7 @@ json=$(cat <${alertemoji} ${alertsubject} ${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${alerturl}", "disable_web_page_preview": "yes" } EOF From db95e4c5961545b75bd4a9499d19a1e53c492f41 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Oct 2021 01:18:56 +0100 Subject: [PATCH 14/14] space --- lgsm/functions/alert_pushover.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/alert_pushover.sh b/lgsm/functions/alert_pushover.sh index 8814060c4..d2c953189 100755 --- a/lgsm/functions/alert_pushover.sh +++ b/lgsm/functions/alert_pushover.sh @@ -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="Server name
${servername}

Trigger Message
${alerttriggermessage}

Game
${gamename}

Current Players
${alertplayers}

Map
${alertmap}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Version
${alertversion}

More info
${alerturl}" "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=" Server name
${servername}

Trigger Message
${alerttriggermessage}

Game
${gamename}

Current Players
${alertplayers}

Map
${alertmap}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Version
${alertversion}

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