Skip to content

Commit 227343c

Browse files
committed
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.
1 parent b02b538 commit 227343c

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

lgsm/functions/command_debug.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ check.sh
2828
fix.sh
2929
info_distro.sh
3030
info_game.sh
31-
# NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh.
3231
fn_print_header
3332
{
3433
echo -e "${lightblue}Distro:\t\t${default}${distroname}"
@@ -40,8 +39,9 @@ fn_print_header
4039
echo -e "${lightblue}Free Memory:\t\t${default}${physmemfree}"
4140
echo -e "${lightblue}Free Disk:\t\t${default}${availspace}"
4241
} | column -s $'\t' -t
42+
4343
# glibc required.
44-
if [ "${glibc}" ]; then
44+
if [ -n "${glibc}" ]; then
4545
if [ "${glibc}" == "null" ]; then
4646
# Glibc is not required.
4747
:
@@ -54,7 +54,7 @@ if [ "${glibc}" ]; then
5454
fi
5555
fi
5656

57-
# Server IP
57+
# Server IP.
5858
echo -e "${lightblue}Game Server IP:\t${default}${ip}:${port}"
5959

6060
# External server IP.
@@ -63,6 +63,7 @@ if [ "${extip}" ]; then
6363
echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}"
6464
fi
6565
fi
66+
6667
# Server password.
6768
if [ "${serverpassword}" ]; then
6869
echo -e "${lightblue}Server password:\t${default}${serverpassword}"
@@ -78,7 +79,7 @@ else
7879
echo -e "${preexecutable} ${executable} ${startparameters}"
7980
fi
8081
echo -e ""
81-
echo -e "Use for identifying server issues only!"
82+
echo -e "Use debug for identifying server issues only!"
8283
echo -e "Press CTRL+c to drop out of debug mode."
8384
fn_print_warning_nl "If ${selfname} is already running it will be stopped."
8485
echo -e ""
@@ -120,6 +121,18 @@ else
120121
eval "${preexecutable} ${executable} ${startparameters}"
121122
fi
122123

124+
if [ $? -ne 0 ]; then
125+
fn_print_error_nl "Server has stopped: exit code: $?"
126+
fn_script_log_error "Server has stopped: exit code: $?"
127+
fn_print_error_nl "Press ENTER to exit debug mode"
128+
read -r
129+
else
130+
fn_print_ok_nl "Server has stopped"
131+
fn_script_log_pass "Server has stopped"
132+
fn_print_ok_nl "Press ENTER to exit debug mode"
133+
read -r
134+
fi
135+
123136
fn_lockfile_trap
124137

125138
fn_print_dots "Stopping debug"

lgsm/functions/fix_steamcmd.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ steamclientsdk64="${steamsdk64}/steamclient.so"
5656
# remove any old unlinked versions of steamclient.so
5757
if [ -f "${steamclientsdk64}" ]; then
5858
if [ "$(stat -c '%h' "${steamclientsdk64}")" -eq 1 ]; then
59-
fixname="steamclient.so sdk64 -- remove old file"
59+
fixname="steamclient.so sdk64 - remove old file"
6060
fn_fix_msg_start
6161
rm -f "${steamclientsdk64}"
6262
fn_fix_msg_end
@@ -87,7 +87,7 @@ steamsdk32="${HOME}/.steam/sdk32"
8787
steamclientsdk32="${HOME}/.steam/sdk32/steamclient.so"
8888
if [ -f "${steamclientsdk32}" ]; then
8989
if [ " $(stat -c '%h' "${steamclientsdk32}")" -eq 1 ]; then
90-
fixname="steamclient.so sdk32 -- remove old file"
90+
fixname="steamclient.so sdk32 - remove old file"
9191
fn_fix_msg_start
9292
rm -f "${steamclientsdk32}"
9393
fn_fix_msg_end

0 commit comments

Comments
 (0)