소스 검색

feat(debug): add press return to exit debug

Since terminal is reset on debug exit this will allow user to see output before this happens.
Daniel Gibbs 3 년 전
부모
커밋
227343c990
2개의 변경된 파일19개의 추가작업 그리고 6개의 파일을 삭제
  1. 17 4
      lgsm/functions/command_debug.sh
  2. 2 2
      lgsm/functions/fix_steamcmd.sh

+ 17 - 4
lgsm/functions/command_debug.sh

@@ -28,7 +28,6 @@ check.sh
 fix.sh
 info_distro.sh
 info_game.sh
-# NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh.
 fn_print_header
 {
 	echo -e "${lightblue}Distro:\t\t${default}${distroname}"
@@ -40,8 +39,9 @@ fn_print_header
 	echo -e "${lightblue}Free Memory:\t\t${default}${physmemfree}"
 	echo -e "${lightblue}Free Disk:\t\t${default}${availspace}"
 } | column -s $'\t' -t
+
 # glibc required.
-if [ "${glibc}" ]; then
+if [ -n "${glibc}" ]; then
 	if [ "${glibc}" == "null" ]; then
 		# Glibc is not required.
 		:
@@ -54,7 +54,7 @@ if [ "${glibc}" ]; then
 	fi
 fi
 
-# Server IP
+# Server IP.
 echo -e "${lightblue}Game Server IP:\t${default}${ip}:${port}"
 
 # External server IP.
@@ -63,6 +63,7 @@ if [ "${extip}" ]; then
 		echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}"
 	fi
 fi
+
 # Server password.
 if [ "${serverpassword}" ]; then
 	echo -e "${lightblue}Server password:\t${default}${serverpassword}"
@@ -78,7 +79,7 @@ else
 	echo -e "${preexecutable} ${executable} ${startparameters}"
 fi
 echo -e ""
-echo -e "Use for identifying server issues only!"
+echo -e "Use debug for identifying server issues only!"
 echo -e "Press CTRL+c to drop out of debug mode."
 fn_print_warning_nl "If ${selfname} is already running it will be stopped."
 echo -e ""
@@ -120,6 +121,18 @@ else
 	eval "${preexecutable} ${executable} ${startparameters}"
 fi
 
+if [ $? -ne 0 ]; then
+	fn_print_error_nl "Server has stopped: exit code: $?"
+	fn_script_log_error "Server has stopped: exit code: $?"
+	fn_print_error_nl "Press ENTER to exit debug mode"
+	read -r
+else
+	fn_print_ok_nl "Server has stopped"
+	fn_script_log_pass "Server has stopped"
+	fn_print_ok_nl "Press ENTER to exit debug mode"
+	read -r
+fi
+
 fn_lockfile_trap
 
 fn_print_dots "Stopping debug"

+ 2 - 2
lgsm/functions/fix_steamcmd.sh

@@ -56,7 +56,7 @@ steamclientsdk64="${steamsdk64}/steamclient.so"
 # remove any old unlinked versions of steamclient.so
 if [ -f "${steamclientsdk64}" ]; then
 	if [ "$(stat -c '%h' "${steamclientsdk64}")" -eq 1 ]; then
-		fixname="steamclient.so sdk64 -- remove old file"
+		fixname="steamclient.so sdk64 - remove old file"
 		fn_fix_msg_start
 		rm -f "${steamclientsdk64}"
 		fn_fix_msg_end
@@ -87,7 +87,7 @@ steamsdk32="${HOME}/.steam/sdk32"
 steamclientsdk32="${HOME}/.steam/sdk32/steamclient.so"
 if [ -f "${steamclientsdk32}" ]; then
 	if [ " $(stat -c '%h' "${steamclientsdk32}")" -eq 1 ]; then
-		fixname="steamclient.so sdk32 -- remove old file"
+		fixname="steamclient.so sdk32 - remove old file"
 		fn_fix_msg_start
 		rm -f "${steamclientsdk32}"
 		fn_fix_msg_end