Преглед изворни кода

fix: address review feedback

- core_dl.sh: use array assignment for steamcmdcommand instead of
  read -r -a to avoid word-splitting on paths
- fix_st.sh: correct module header typo (fix_ts.sh -> fix_st.sh)
- command_skeleton.sh: fix grammar 'Creates an copy' -> 'Creates a copy'
- serverlist-validate-game-icons.sh: anchor grep to start-of-line and
  require trailing comma to prevent false positives (e.g. 'tf' matching
  'tf2' entries)
- cs2server/_default.cfg: remove duplicate ntfy alert settings block
Daniel Gibbs пре 1 месец
родитељ
комит
d04d5b6dfd

+ 1 - 1
.github/workflows/serverlist-validate-game-icons.sh

@@ -22,7 +22,7 @@ shopt -s nullglob
 for gameiconpath in gameicons/*; do
 for gameiconpath in gameicons/*; do
 	gameicon="$(basename "${gameiconpath}")"
 	gameicon="$(basename "${gameiconpath}")"
 	# check if $gameicon is in serverlist.csv
 	# check if $gameicon is in serverlist.csv
-	if ! grep -q -F "${gameicon%-icon.png}" serverlist.csv; then
+	if ! grep -q -E "^${gameicon%-icon.png}," serverlist.csv; then
 		echo "ERROR: gameicon ${gameicon} is not in serverlist.csv"
 		echo "ERROR: gameicon ${gameicon} is not in serverlist.csv"
 		exitcode=1
 		exitcode=1
 	else
 	else

+ 0 - 10
lgsm/config-default/config-lgsm/cs2server/_default.cfg

@@ -72,16 +72,6 @@ ntfypassword=""
 ntfypriority=""
 ntfypriority=""
 ntfytags=""
 ntfytags=""
 
 
-# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy
-ntfyalert="off"
-ntfytopic="LinuxGSM"
-ntfyserver="https://ntfy.sh"
-ntfytoken=""
-ntfyusername=""
-ntfypassword=""
-ntfypriority=""
-ntfytags=""
-
 # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
 # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
 pushbulletalert="off"
 pushbulletalert="off"
 pushbullettoken="accesstoken"
 pushbullettoken="accesstoken"

+ 1 - 1
lgsm/modules/command_skeleton.sh

@@ -3,7 +3,7 @@
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Contributors: https://linuxgsm.com/contrib
 # Contributors: https://linuxgsm.com/contrib
 # Website: https://linuxgsm.com
 # Website: https://linuxgsm.com
-# Description: Creates an copy of a game servers directories.
+# Description: Creates a copy of a game server directories.
 
 
 commandname="SKELETON"
 commandname="SKELETON"
 commandaction="Skeleton"
 commandaction="Skeleton"

+ 3 - 3
lgsm/modules/core_dl.sh

@@ -46,9 +46,9 @@ fn_dl_steamcmd() {
 		validate="validate"
 		validate="validate"
 	fi
 	fi
 
 
-	# steamcmdcommand can contain multiple arguments; treat it as an argv array.
-	steamcmdcommandarray=()
-	read -r -a steamcmdcommandarray <<< "${steamcmdcommand}"
+	# Wrap steamcmdcommand as a single-element array to avoid word-splitting
+	# on paths/commands that should not be tokenised.
+	steamcmdcommandarray=("${steamcmdcommand}")
 	unbuffercommand=()
 	unbuffercommand=()
 	if [ -n "${unbuffer}" ]; then
 	if [ -n "${unbuffer}" ]; then
 		unbuffercommand=("${unbuffer}")
 		unbuffercommand=("${unbuffer}")

+ 1 - 1
lgsm/modules/fix_st.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
 #!/bin/bash
-# LinuxGSM fix_ts.sh module
+# LinuxGSM fix_st.sh module
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Contributors: https://linuxgsm.com/contrib
 # Contributors: https://linuxgsm.com/contrib
 # Website: https://linuxgsm.com
 # Website: https://linuxgsm.com