Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
cfa873c
feat: refactor update comparison output for consistency and clarity
dgibbs64 Aug 12, 2025
bdfc6e5
Refactor remote build version handling across multiple modules
dgibbs64 Aug 13, 2025
9c36976
fix(alert): resolve issue with servername not always being listed in …
dgibbs64 Aug 13, 2025
4d0d110
fix(alert_discord): remove "More info" field from Discord alert JSON
dgibbs64 Aug 13, 2025
6580b89
fix(alert): improve update alert messaging for clarity
dgibbs64 Aug 13, 2025
24183e7
Merge branch 'develop' into 4696-bug-discord-alert-on-update-uses-the…
dgibbs64 Nov 10, 2025
7abedc4
remove inline
dgibbs64 Nov 10, 2025
c707de8
fix(alert): Correct grammar in update alert message
dgibbs64 Nov 10, 2025
e5026a8
typo
dgibbs64 Nov 10, 2025
ee1dca9
fix(alert_discord): Add inline property to "Is my Game Server Online?…
dgibbs64 Nov 10, 2025
7db6735
fix(pd): increase timeout for termbin.com connection
dgibbs64 Nov 10, 2025
b25fabf
fix(alert_discord): reorder fields in Discord alert JSON
dgibbs64 Nov 10, 2025
65bc057
revert back to factorio.com
dgibbs64 Feb 8, 2026
a5e58d4
Standardizes alert messages across platforms
dgibbs64 Feb 8, 2026
203853f
Removes Hostname from alert messages
dgibbs64 Feb 8, 2026
00265e5
Merge branch 'develop' into 4696-bug-discord-alert-on-update-uses-the…
dgibbs64 Feb 8, 2026
1eb6ae1
Configures shellcheckrc filename
dgibbs64 Feb 8, 2026
5e2d0de
Merge remote-tracking branch 'origin/4696-bug-discord-alert-on-update…
dgibbs64 Feb 8, 2026
52ae5d0
Disables shellcheck errors and removes variable
dgibbs64 Feb 8, 2026
7731e9e
Fixes and improves server list validation scripts
dgibbs64 Feb 8, 2026
b3d2700
Fixes glibc check and mod selection logic
dgibbs64 Feb 8, 2026
a79b528
Fixes cache control for dev-debug mode
dgibbs64 Feb 8, 2026
607f896
Allows spaces in steamcmdcommand variable
dgibbs64 Feb 8, 2026
cb3a092
Addresses various script improvements
dgibbs64 Feb 8, 2026
52b579d
Fixes mono repo install exit code check
dgibbs64 Feb 8, 2026
5691e52
Refactors and reorders core modules
dgibbs64 Feb 9, 2026
30afa80
Makes scripts executable
dgibbs64 Feb 9, 2026
61d335f
Adds explicit permissions to workflows
dgibbs64 Feb 9, 2026
ea4468d
Fixes output redirection and URL parsing
dgibbs64 Feb 9, 2026
42d38a5
Applies code formatting for consistency
dgibbs64 Feb 9, 2026
11776f7
Fixes minor formatting and logic issues
dgibbs64 Feb 9, 2026
74aae8a
Configures and disables linters
dgibbs64 Feb 9, 2026
35eab4a
Improves documentation and linting
dgibbs64 Feb 9, 2026
cd45f4f
Fixes typos and improves code consistency
dgibbs64 Feb 9, 2026
17dc48e
Excludes workflow files from Prettier formatting
dgibbs64 Feb 9, 2026
5023490
chore(prettier): format code
dgibbs64 Feb 9, 2026
3eb8213
Updates Super-Linter configuration
dgibbs64 Feb 9, 2026
8ff1328
Merge branch 'develop' into 4696-bug-discord-alert-on-update-uses-the…
dgibbs64 Mar 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .shellcheckrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
disable=SC2154
disable=SC2154,SC2034
Comment thread
dgibbs64 marked this conversation as resolved.
59 changes: 40 additions & 19 deletions lgsm/modules/alert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fn_alert_update() formats the update alert using ${previousbuild} -> ${localbuild} (or just ${localbuild}), but most update modules in this PR still call alert.sh with localbuild set to the pre-update version and never set previousbuild (only update_fctr.sh does). This means update alerts will still report the old version (or won’t show a transition) for most servers. Consider using ${localbuild} -> ${remotebuild} when remotebuild is available, or standardize all update paths to set previousbuild before updating and refresh localbuild after updating before calling alert.sh.

Suggested change
# 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}."

Copilot uses AI. Check for mistakes.
else
fn_script_log_info "Sending alert: ${selfname} updated to ${localbuild}"
alertmessage="${selfname} updated to ${localbuild}."
fi
alertaction="Updated"
alertemoji="🎉"
alertsound="1"
alertmessage="${selfname} has received a game server update: ${localbuild}."
# Green
alertcolourhex="#00cd00"
alertcolourdec="52480"
}

fn_alert_update_request() {
fn_script_log_info "Sending alert: ${selfname} has requested an update and needs to be restarted."
alertaction="Updating"
# Update failure alert
fn_alert_update_failed() {
# Expect updatefailureexpected (target version) and updatefailuregot (actual localbuild) if set
local updateexpected="${updatefailureexpected:-${remotebuild:-unknown}}"
local updategot="${updatefailuregot:-${localbuild:-unknown}}"
fn_script_log_error "Sending alert: ${selfname} update failed: expected ${updateexpected}, got ${updategot}"
alertaction="Update Failed"
alertemoji="❌"
alertsound="2"
alertmessage="${selfname} update failed: expected ${updateexpected}, got ${updategot}. Manual intervention required."
# Red
alertcolourhex="#cd0000"
alertcolourdec="13434880"
}

fn_alert_update_restart_request() {
fn_script_log_info "Sending alert: ${selfname} restart requested"
alertaction="Restart Requested"
alertemoji="🎉"
alertsound="1"
alertmessage="${selfname} has requested an update and needs to be restarted."
alertmessage="${selfname} has requested a restart for an update to be applied. Restarting now."
# Blue
alertcolourhex="#1e90ff"
alertcolourdec="2003199"
}

fn_alert_check_update() {
fn_script_log_info "Sending alert: ${gamename} update available: ${remotebuildversion}"
alertaction="Update available"
fn_script_log_info "Sending alert: ${gamename} update available: ${localbuild} -> ${remotebuild}"
alertaction="Update Available"
alertemoji="🎉"
alertsound="1"
alertmessage="${gamename} update available: ${remotebuildversion}"
alertmessage="${gamename} update available: ${localbuild} -> ${remotebuild}"
# Blue
alertcolourhex="#1e90ff"
alertcolourdec="2003199"
}

fn_alert_update_linuxgsm() {
fn_script_log_info "Sending alert: ${selfname} has received an LinuxGSM update"
fn_script_log_info "Sending alert: ${selfname} has received a LinuxGSM update"
Comment thread
dgibbs64 marked this conversation as resolved.
alertaction="Updated"
alertemoji="🎉"
alertsound="1"
alertbody="${gamename} update available"
alertmessage="${selfname} has received an LinuxGSM update and been restarted."
alertmessage="${selfname} has received a LinuxGSM update and been restarted."
# Green
alertcolourhex="#00cd00"
alertcolourdec="52480"
Expand Down Expand Up @@ -197,8 +214,9 @@ fn_alert_info() {
alertcolourdec="2003199"
}

# Images
alerticon="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/gameicons/${shortname}-icon.png"
info_distro.sh
info_game.sh
info_messages.sh

if [ "${alert}" == "permissions" ]; then
fn_alert_permissions
Expand All @@ -210,8 +228,10 @@ elif [ "${alert}" == "test" ]; then
fn_alert_test
elif [ "${alert}" == "update" ]; then
fn_alert_update
elif [ "${alert}" == "update-request" ]; then
fn_alert_update_request
elif [ "${alert}" == "update-failed" ]; then
fn_alert_update_failed
elif [ "${alert}" == "update-restart-request" ]; then
fn_alert_update_restart_request
elif [ "${alert}" == "check-update" ]; then
fn_alert_check_update
elif [ "${alert}" == "config" ]; then
Expand All @@ -237,6 +257,7 @@ else
fi

alerttitle="${alertemoji} ${alertaction} - ${servername} ${alertemoji}"
alerticon="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/gameicons/${shortname}-icon.png"

# Generate alert log.
fn_alert_log
Expand Down
21 changes: 10 additions & 11 deletions lgsm/modules/alert_discord.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,39 +43,38 @@ json=$(
"inline": true
},
{
"name": "Server Time",
"value": "$(date)",
"name": "Server IP",
"value": "\`${alertip}:${port}\`",
"inline": true
},
{
"name": "More info",
"value": "${alerturl}",
"name": "Server Time",
"value": "$(date)",
"inline": true
}
EOF
)

if [ -n "${querytype}" ]; then
if [ -n "${alerturl}" ]; then
json+=$(
cat << EOF
,
{
"name": "Is my Game Server Online?",
"value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}",
"name": "More info",
"value": "${alerturl}",
"inline": true
}
EOF
)
fi

if [ -n "${alerturl}" ]; then
if [ -n "${querytype}" ]; then
json+=$(
cat << EOF
,
{
"name": "More info",
"value": "${alerturl}",
"inline": true
"name": "Is my Game Server Online?",
"value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}"
}
EOF
)
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/alert_gotify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON payload is assembled by keeping the message string open across heredocs, which embeds literal newlines inside a JSON string (invalid JSON) and will make jq -c . fail. Please build the full message string separately (with explicit \n escapes) and then include it as a single quoted JSON string, or construct the JSON using jq -n --arg message ....

Copilot uses AI. Check for mistakes.
)

Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/alert_ifttt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This JSON construction leaves the value3 string unterminated across multiple heredocs, which inserts literal newline characters into an open JSON string. jq -c . will not parse that JSON. Build the message body separately (using printf with \n escapes) and then set value3 in one shot (or generate the whole payload via jq -n --arg value3 ...).

Copilot uses AI. Check for mistakes.
)

Expand Down
26 changes: 17 additions & 9 deletions lgsm/modules/alert_ntfy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,31 @@ else
tags="${alertemoji}"
fi

# Construct the message body
message="Server Name: ${servername}
Information: ${alertmessage}
Game: ${gamename}
Server IP: ${alertip}:${port}
Hostname: ${HOSTNAME}
Server Time: $(date)"
# Construct the message body (keep formatting consistent with other plain-text alerts)
message="Server Name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Server Time
$(date)"

# Add optional links if available
if [ -n "${querytype}" ]; then
message+="\nIs my Game Server Online?: https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}"
message+="\n\nIs my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}"
fi

# Use alerturl for the click action if available
clickurl=""
if [ -n "${alerturl}" ]; then
message+="\nMore info: ${alerturl}"
message+="\n\nMore info\n${alerturl}"
clickurl="${alerturl}"
fi

Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/alert_pushbullet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON payload construction leaves the body string open across heredocs, which causes literal newlines to be embedded in an unescaped JSON string. This makes the JSON invalid and will cause jq -c . to error. Consider building the full message string separately (with explicit \n escapes) and then include it as a single JSON string value (or generate the JSON with jq -n --arg body ...).

Copilot uses AI. Check for mistakes.
)

Expand Down
4 changes: 2 additions & 2 deletions lgsm/modules/alert_pushover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ else
alertpriority="0"
fi

message=" <b>Server name</b><br>${servername}<br><br><b>Information</b><br>${alertmessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br>"
message=" <b>Server Name</b><br>${servername}<br><br><b>Information</b><br>${alertmessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br>"

if [ -n "${querytype}" ]; then
message+="<b>Is my Game Server Online?</b><br><a href='https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}'>Check here</a><br><br>"
Expand All @@ -32,7 +32,7 @@ if [ -n "${alerturl}" ]; then
message+="<b>More info</b><br><a href='${alerturl}'>${alerturl}</a><br><br>"
fi

message+="Server Time<br>$(date)"
message+="<b>Server Time</b><br>$(date)"

pushoversend=$(curl --connect-timeout 3 -sS \
-F token="${pushovertoken}" \
Expand Down
66 changes: 6 additions & 60 deletions lgsm/modules/alert_rocketchat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,94 +40,40 @@ json=$(
{
"short": false,
"title": "Server IP",
"value": "${alertip}:${port}"
},
{
"short": false,
"title": "Hostname",
"value": "${HOSTNAME}"
},
{
"short": false,
"title": "More info",
"value": "${alerturl}"
},
{
"short": false,
"title": "Server Time",
"value": "$(date)"
"value": "\`${alertip}:${port}\`"
}
]
}
]
}
EOF
)

if [ -n "${querytype}" ]; then
json+=$(
cat << EOF
,
{
"short": false,
"title": "Is my Game Server Online?",
"value": "<https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}|Check here>"
},
}
EOF
)
fi

if [ -n "${alerturl}" ]; then
json+=$(
cat << EOF
,
{
"short": false,
"title": "More info",
"value": "${alerturl}"
},
}
EOF
)
fi

json+=$(
cat << EOF
{
"alias": "LinuxGSM",
"text": "*${alerttitle}*",
"attachments": [
{
"title": "",
"color": "${alertcolourhex}",
"author_name": "LinuxGSM Alert",
"author_link": "https://linuxgsm.com",
"author_icon": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
"thumb_url": "${alerticon}",
"text": "",
"fields": [
{
"short": false,
"title": "Server Name",
"value": "${servername}"
},
{
"short": false,
"title": "Information",
"value": "${alertmessage}"
},
{
"short": false,
"title": "Game",
"value": "${gamename}"
},
{
"short": false,
"title": "Server IP",
"value": "${alertip}:${port}"
},
{
"short": false,
"title": "Hostname",
"value": "${HOSTNAME}"
},
,
{
"short": false,
"title": "Server Time",
Expand Down
Loading
Loading