-
-
Notifications
You must be signed in to change notification settings - Fork 859
fix (alerts): Alerts on update uses the old game server version not the new one #4854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 16 commits
cfa873c
bdfc6e5
9c36976
4d0d110
6580b89
24183e7
7abedc4
c707de8
e5026a8
ee1dca9
7db6735
b25fabf
65bc057
a5e58d4
203853f
00265e5
1eb6ae1
5e2d0de
52ae5d0
7731e9e
b3d2700
a79b528
607f896
cb3a092
52b579d
5691e52
30afa80
61d335f
ea4468d
42d38a5
11776f7
74aae8a
35eab4a
cd45f4f
17dc48e
5023490
3eb8213
8ff1328
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| disable=SC2154 | ||
| disable=SC2154,SC2034 | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,13 +10,9 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" | |||||||||||||||||||||||||||||||||
| # Generates alert log of the details at the time of the alert. | ||||||||||||||||||||||||||||||||||
| # Used with email alerts. | ||||||||||||||||||||||||||||||||||
| fn_alert_log() { | ||||||||||||||||||||||||||||||||||
| info_distro.sh | ||||||||||||||||||||||||||||||||||
| info_game.sh | ||||||||||||||||||||||||||||||||||
| info_messages.sh | ||||||||||||||||||||||||||||||||||
| if [ -f "${alertlog}" ]; then | ||||||||||||||||||||||||||||||||||
| rm -f "${alertlog:?}" | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||
| fn_info_messages_head | ||||||||||||||||||||||||||||||||||
| fn_info_messages_distro | ||||||||||||||||||||||||||||||||||
|
|
@@ -97,45 +93,66 @@ fn_alert_monitor_query() { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Update alerts | ||||||||||||||||||||||||||||||||||
| fn_alert_update() { | ||||||||||||||||||||||||||||||||||
| fn_script_log_info "Sending alert: ${selfname} has received a game server update: ${localbuild}" | ||||||||||||||||||||||||||||||||||
| # If previousbuild is set show transition, else fallback to single version. | ||||||||||||||||||||||||||||||||||
| if [ -n "${previousbuild:-}" ] && [ -n "${localbuild:-}" ]; then | ||||||||||||||||||||||||||||||||||
| fn_script_log_info "Sending alert: ${selfname} updated: ${previousbuild} -> ${localbuild}" | ||||||||||||||||||||||||||||||||||
| alertmessage="${selfname} updated: ${previousbuild} -> ${localbuild}." | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+96
to
+99
|
||||||||||||||||||||||||||||||||||
| # If previousbuild is set show transition, else fallback to single version. | |
| if [ -n "${previousbuild:-}" ] && [ -n "${localbuild:-}" ]; then | |
| fn_script_log_info "Sending alert: ${selfname} updated: ${previousbuild} -> ${localbuild}" | |
| alertmessage="${selfname} updated: ${previousbuild} -> ${localbuild}." | |
| # Prefer previousbuild -> localbuild when available. | |
| if [ -n "${previousbuild:-}" ] && [ -n "${localbuild:-}" ]; then | |
| fn_script_log_info "Sending alert: ${selfname} updated: ${previousbuild} -> ${localbuild}" | |
| alertmessage="${selfname} updated: ${previousbuild} -> ${localbuild}." | |
| # If previousbuild is not set but remotebuild is available, show localbuild -> remotebuild. | |
| elif [ -z "${previousbuild:-}" ] && [ -n "${localbuild:-}" ] && [ -n "${remotebuild:-}" ]; then | |
| fn_script_log_info "Sending alert: ${selfname} updated: ${localbuild} -> ${remotebuild}" | |
| alertmessage="${selfname} updated: ${localbuild} -> ${remotebuild}." | |
| # If only remotebuild is available, fall back to showing the updated-to version. | |
| elif [ -n "${remotebuild:-}" ]; then | |
| fn_script_log_info "Sending alert: ${selfname} updated to ${remotebuild}" | |
| alertmessage="${selfname} updated to ${remotebuild}." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ json=$( | |
| cat << EOF | ||
| { | ||
| "title": "${alerttitle}", | ||
| "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n | ||
| "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n | ||
| EOF | ||
|
Comment on lines
12
to
15
|
||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ json=$( | |
| { | ||
| "value1": "${selfname}", | ||
| "value2": "${alerttitle}", | ||
| "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n | ||
| "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n | ||
| EOF | ||
|
Comment on lines
13
to
16
|
||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ json=$( | |
| "channel_tag": "${channeltag}", | ||
| "type": "note", | ||
| "title": "${alerttitle}", | ||
| "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n | ||
| "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n | ||
| EOF | ||
|
Comment on lines
14
to
17
|
||
| ) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.