Procházet zdrojové kódy

feat: add steamcmd checking to monitor

Daniel Gibbs před 2 roky
rodič
revize
6716839c8b
2 změnil soubory, kde provedl 8 přidání a 11 odebrání
  1. 5 5
      lgsm/functions/check.sh
  2. 3 6
      lgsm/modules/command_monitor.sh

+ 5 - 5
lgsm/functions/check.sh

@@ -31,7 +31,7 @@ if [ "${commandname}" != "INSTALL" ] && [ "${commandname}" != "UPDATE-LGSM" ] &&
 	check_system_dir.sh
 fi
 
-allowed_commands_array=(START DEBUG)
+allowed_commands_array=(DEBUG START)
 for allowed_command in "${allowed_commands_array[@]}"; do
 	if [ "${allowed_command}" == "${commandname}" ]; then
 		check_executable.sh
@@ -47,7 +47,7 @@ if [ "$(whoami)" != "root" ] || [ -f /.dockerenv ]; then
 	done
 fi
 
-allowed_commands_array=(BACKUP CONSOLE DEBUG DETAILS MAP-COMPRESSOR FASTDL MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT CHANGE-PASSWORD UPDATE UPDATE-LGSM VALIDATE WIPE)
+allowed_commands_array=(BACKUP CHANGE-PASSWORD CONSOLE DEBUG DETAILS FASTDL MAP-COMPRESSOR MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT UPDATE UPDATE-LGSM VALIDATE WIPE)
 for allowed_command in "${allowed_commands_array[@]}"; do
 	if [ "${allowed_command}" == "${commandname}" ]; then
 		check_logs.sh
@@ -68,7 +68,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do
 	fi
 done
 
-allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS START STOP POST-DETAILS)
+allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST-DETAILS START STOP)
 for allowed_command in "${allowed_commands_array[@]}"; do
 	if [ "${allowed_command}" == "${commandname}" ]; then
 		if [ -z "${installflag}" ]; then
@@ -77,7 +77,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do
 	fi
 done
 
-allowed_commands_array=(DEBUG START UPDATE VALIDATE CHECK-UPDATE)
+allowed_commands_array=(CHECK-UPDATE DEBUG MONITOR START UPDATE VALIDATE)
 for allowed_command in "${allowed_commands_array[@]}"; do
 	if [ "${allowed_command}" == "${commandname}" ]; then
 		if [ "${appid}" ]; then
@@ -86,7 +86,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do
 	fi
 done
 
-allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS)
+allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR POST-DETAILS START STOP UPDATE VALIDATE)
 for allowed_command in "${allowed_commands_array[@]}"; do
 	if [ "${allowed_command}" == "${commandname}" ]; then
 		check_status.sh

+ 3 - 6
lgsm/modules/command_monitor.sh

@@ -72,13 +72,10 @@ fn_monitor_check_update() {
 	# Monitor will check if an update is running.
 	if [ "$(pgrep -fc "${selfname} update")" != "0" ] || [ "$(pgrep -fc "${selfname} u")" != "0" ] || [ "$(pgrep -fc "${selfname} validate")" != "0" ] || [ "$(pgrep -fc "${selfname} v")" != "0" ]; then
 		# Specific check for docker. Will ignore the command watch -n 1800 ./csgoserver update
-		if [ "$(pgrep -fc "n*${selfname} update")" != "0" ]; then
-			fn_print_dots "Checking active updates: "
-			fn_print_checking_eol
-			fn_script_log_info "Checking active updates: CHECKING"
-			fn_print_info_nl "Checking active updates: SteamCMD is currently checking for updates: "
+		if [ "$(pgrep -fc "n*${selfname} update")" == "0" ]; then
+			fn_print_info_nl "Checking lockfile: LinuxGSM is currently checking for updates: "
 			fn_print_info_eol
-			fn_script_log_pass "Checking active updates: SteamCMD is currently checking for updates"
+			fn_script_log_pass "Checking lockfile: LinuxGSM is currently checking for updates"
 			core_exit.sh
 		fi
 	fi