@@ -26,69 +26,69 @@ fn_monitor_check_monitoring() {
26
26
}
27
27
28
28
fn_monitor_check_install () {
29
- if [ " $( pgrep -fc -u " ${USER} " " ${selfname} install" ) " != " 0" ] || [ " $( pgrep -fc -u " ${USER} " " ${selfname} i" ) " != " 0" ] || [ " $( pgrep -fc -u " ${USER} " " ${selfname} auto-install" ) " != " 0" ] || [ " $( pgrep -fc -u " ${USER} " " ${selfname} ai" ) " != " 0" ]; then
29
+ if [ " $( pgrep -fc -u " ${USER} " " /bin/bash ./ ${selfname} install" ) " != " 0" ] || [ " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} i" ) " != " 0" ] || [ " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} auto-install" ) " != " 0" ] || [ " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} ai" ) " != " 0" ]; then
30
30
fn_print_dots " Checking installer: "
31
31
fn_print_checking_eol
32
32
fn_script_log_info " Checking installer: CHECKING"
33
- fn_print_info " Checking installer: Installer is : "
34
- fn_print_info_eol
33
+ fn_print_info " Checking installer: LinuxGSM is installing : "
34
+ fn_print_info_eol_nl
35
35
fn_script_log_pass " Checking installer: LinuxGSM is installing"
36
36
core_exit.sh
37
37
fi
38
38
}
39
39
40
40
fn_monitor_check_debug () {
41
- if [ " $( pgrep -fc -u " ${USER} " " ${selfname} debug" ) " != " 0" ] || [ " $( pgrep -fc -u " ${USER} " " ${selfname} d" ) " != " 0" ]; then
41
+ if [ " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} debug" ) " != " 0" ] || [ " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} d" ) " != " 0" ]; then
42
42
fn_print_dots " Checking debug: "
43
43
fn_print_checking_eol
44
44
fn_print_info " Checking debug: Debug is running: "
45
- fn_print_info_eol
45
+ fn_print_info_eol_nl
46
46
fn_script_log_pass " Checking debug: Debug is running"
47
47
core_exit.sh
48
48
fi
49
49
}
50
50
51
- fn_monitor_check_starting (){
51
+ fn_monitor_check_starting () {
52
52
# Remove stale lockfile.
53
53
if [ -f " ${lockdir} /${selfname} -starting.lock" ]; then
54
54
if [ " $( find " ${lockdir} /${selfname} -starting.lock" -mmin +5) " ]; then
55
55
fn_print_dots " Checking start: "
56
56
fn_print_checking_eol
57
57
fn_print_warn " Checking start: Removing stale lockfile: "
58
- fn_print_warn_eol
58
+ fn_print_warn_eol_nl
59
59
fn_script_log_warn " Checking start: Removing stale lockfile"
60
60
rm -f " ${lockdir:? } /${selfname} -starting.lock"
61
61
fi
62
62
fi
63
63
64
- if [ -f " ${lockdir} /${selfname} -starting.lock" ] && [[ " $( pgrep -fc -u " ${USER} " " ${selfname} start" ) " != " 0" || " $( pgrep -fc -u " ${USER} " " ${selfname} s" ) " != " 0" ]]; then
64
+ if [ -f " ${lockdir} /${selfname} -starting.lock" ] && [[ " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} start" ) " != " 0" || " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} s" ) " != " 0" ]]; then
65
65
fn_print_dots " Checking start: "
66
66
fn_print_checking_eol
67
67
fn_print_info " Checking start: LinuxGSM is starting: "
68
- fn_print_info_eol
68
+ fn_print_info_eol_nl
69
69
fn_script_log_info " Checking backup: LinuxGSM is starting"
70
70
core_exit.sh
71
71
fi
72
72
}
73
73
74
- fn_monitor_check_stopping (){
74
+ fn_monitor_check_stopping () {
75
75
# Remove stale lockfile.
76
76
if [ -f " ${lockdir} /${selfname} -stopping.lock" ]; then
77
77
if [ " $( find " ${lockdir} /${selfname} -stopping.lock" -mmin +5) " ]; then
78
78
fn_print_dots " Checking stop: "
79
79
fn_print_checking_eol
80
80
fn_print_warn " Checking stop: Removing stale lockfile: "
81
- fn_print_warn_eol
81
+ fn_print_warn_eol_nl
82
82
fn_script_log_warn " Checking stop: Removing stale lockfile"
83
83
rm -f " ${lockdir:? } /${selfname} -stopping.lock"
84
84
fi
85
85
fi
86
86
87
- if [ -f " ${lockdir} /${selfname} -stopping.lock" ] && [[ " $( pgrep -fc -u " ${USER} " " ${selfname} stop" ) " != " 0" || " $( pgrep -fc -u " ${USER} " " ${selfname} s" ) " != " 0" ]]; then
87
+ if [ -f " ${lockdir} /${selfname} -stopping.lock" ] && [[ " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} stop" ) " != " 0" || " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} s" ) " != " 0" ]]; then
88
88
fn_print_dots " Checking stop: "
89
89
fn_print_checking_eol
90
90
fn_print_info " Checking stop: LinuxGSM is stopping: "
91
- fn_print_info_eol
91
+ fn_print_info_eol_nl
92
92
fn_script_log_info " Checking backup: LinuxGSM is stopping"
93
93
core_exit.sh
94
94
fi
@@ -107,11 +107,11 @@ fn_monitor_check_backup() {
107
107
fi
108
108
fi
109
109
110
- if [ -f " ${lockdir} /backup.lock" ] && [[ " $( pgrep -fc -u " ${USER} " " ${selfname} backup" ) " != " 0" || " $( pgrep -fc -u " ${USER} " " ${selfname} b" ) " != " 0" ]]; then
110
+ if [ -f " ${lockdir} /backup.lock" ] && [[ " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} backup" ) " != " 0" || " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} b" ) " != " 0" ]]; then
111
111
fn_print_dots " Checking backup: "
112
112
fn_print_checking_eol
113
113
fn_print_info " Checking backup: Backup is running: "
114
- fn_print_info_eol
114
+ fn_print_info_eol_nl
115
115
fn_script_log_info " Checking backup: Backup is running"
116
116
core_exit.sh
117
117
fi
@@ -124,38 +124,38 @@ fn_monitor_check_update() {
124
124
fn_print_dots " Checking update: "
125
125
fn_print_checking_eol
126
126
fn_print_warn " Checking update: Removing stale lockfile: "
127
- fn_print_warn_eol
127
+ fn_print_warn_eol_nl
128
128
fn_script_log_warn " Checking update: Removing stale lockfile"
129
129
rm -f " ${lockdir:? } /update.lock"
130
130
fi
131
131
fi
132
132
133
- if [ -f " ${lockdir} /update.lock" ] && [[ " $( pgrep -fc -u " ${USER} " " ${selfname} update" ) " != " 0" || " $( pgrep -fc -u " ${USER} " " ${selfname} validate" ) " != " 0" || " $( pgrep -fc -u " ${USER} " " ${selfname} v" ) " != " 0" || " $( pgrep -fc force-update " ${USER} " " ${selfname} fu" ) " != " 0" ]]; then
133
+ if [ -f " ${lockdir} /update.lock" ] && [[ " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} update" ) " != " 0" || " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} validate" ) " != " 0" || " $( pgrep -fcx -u " ${USER} " " /bin/bash ./ ${selfname} v" ) " != " 0" || " $( pgrep -fc force-update " ${USER} " " /bin/bash ./ ${selfname} fu" ) " != " 0" ]]; then
134
134
fn_print_dots " Checking update: "
135
135
fn_print_checking_eol
136
136
fn_print_info " Checking update: LinuxGSM is updating the game server: "
137
- fn_print_info_eol
137
+ fn_print_info_eol_nl
138
138
fn_script_log_pass " Checking update: LinuxGSM is updating the game server"
139
139
core_exit.sh
140
140
fi
141
141
}
142
142
143
143
# Source engine games may display a messages to indicate the server needs restarting.
144
- fn_monitor_check_update_source (){
145
- if [ -f " ${consolelogdir} /${selfname} -console.log" ] && [ " ${engine} " == " source" ]; then
146
- if grep -q " Your server needs to be restarted in order to receive the latest update." " ${consolelogdir} /${selfname} -console.log" ; then
147
- fn_print_dots " Checking update: "
148
- fn_print_checking_eol
149
- fn_script_log_info " Checking update: CHECKING"
150
- fn_print_ok " Checking update: "
151
- fn_print_ok_eol_nl
152
- fn_script_log_info " Checking update: Monitor is restarting ${selfname} to apply update"
153
- alert=" restart"
154
- alert.sh
155
- command_restart.sh
156
- core_exit.sh
157
- fi
158
- fi
144
+ fn_monitor_check_update_source () {
145
+ if [ -f " ${consolelogdir} /${selfname} -console.log" ] && [ " ${engine} " == " source" ]; then
146
+ if grep -q " Your server needs to be restarted in order to receive the latest update." " ${consolelogdir} /${selfname} -console.log" ; then
147
+ fn_print_dots " Checking update: "
148
+ fn_print_checking_eol
149
+ fn_script_log_info " Checking update: CHECKING"
150
+ fn_print_ok " Checking update: "
151
+ fn_print_ok_eol_nl
152
+ fn_script_log_info " Checking update: Monitor is restarting ${selfname} to apply update"
153
+ alert=" restart"
154
+ alert.sh
155
+ command_restart.sh
156
+ core_exit.sh
157
+ fi
158
+ fi
159
159
}
160
160
161
161
fn_monitor_check_session () {
@@ -166,7 +166,7 @@ fn_monitor_check_session() {
166
166
sessionwidth=" 80"
167
167
sessionheight=" 23"
168
168
# Check for PIDS with identical tmux sessions running.
169
- if [ " $( pgrep -fc " tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname} " ) " -ge " 2" ]; then
169
+ if [ " $( pgrep -fcx " tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname} " ) " -ge " 2" ]; then
170
170
fn_print_error " Checking session: "
171
171
fn_print_error_eol_nl
172
172
fn_script_log_error " Checking session: ERROR"
0 commit comments