@@ -12,11 +12,14 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
12
12
fn_firstcommand_set
13
13
14
14
fn_monitor_check_lockfile () {
15
- # Monitor does not run it lockfile is not found.
15
+ # Monitor does not run if lockfile is not found.
16
16
if [ ! -f " ${lockdir} /${selfname} .lock" ]; then
17
17
fn_print_dots " Checking lockfile: "
18
18
fn_print_checking_eol
19
19
fn_script_log_info " Checking lockfile: CHECKING"
20
+ fn_monitor_check_update
21
+ fn_monitor_check_backup
22
+ fn_monitor_check_debug
20
23
fn_print_error " Checking lockfile: No lockfile found: "
21
24
fn_print_error_eol_nl
22
25
fn_script_log_error " Checking lockfile: No lockfile found: ERROR"
@@ -32,19 +35,55 @@ fn_monitor_check_lockfile() {
32
35
fi
33
36
}
34
37
35
- fn_monitor_check_update () {
36
- # Monitor will check if update is already running.
37
- if [ " $( pgrep " ${selfname} update" | wc -l) " != " 0" ]; then
38
- fn_print_dots " Checking active updates: "
38
+ fn_monitor_check_backup () {
39
+ # Monitor will check if backup is running.
40
+ if [ " $( pgrep " ${selfname} backup" | wc -l) " != " 0" ] || [ " $( pgrep " ${selfname} b" | wc -l) " != " 0" ]; then
41
+ fn_print_info_nl " Checking lockfile: LinuxGSM is currently running a backup: "
42
+ fn_print_info_eol
43
+ fn_script_log_info " Checking lockfile: LinuxGSM is currently running a backup"
44
+ core_exit.sh
45
+ fi
46
+ }
47
+
48
+ fn_monitor_check_debug () {
49
+ # Monitor will check if backup is running.
50
+ if [ " $( pgrep -fc " ${selfname} backup" ) " != " 0" ] || [ " $( pgrep -fc " ${selfname} b" ) " != " 0" ]; then
51
+ fn_print_info_nl " Checking lockfile: LinuxGSM is currently in debug mode: "
52
+ fn_print_info_eol
53
+ fn_script_log_pass " Checking lockfile: LinuxGSM is currently in debug mode"
54
+ core_exit.sh
55
+ fi
56
+ }
57
+
58
+ fn_monitor_check_install () {
59
+ # Monitor will check if update is running.
60
+ if [ " $( pgrep -fc " ${selfname} install" ) " != " 0" ] || [ " $( pgrep -fc " ${selfname} i" ) " != " 0" ] || [ " $( pgrep -fc " ${selfname} auto-install" ) " != " 0" ] || [ " $( pgrep -fc " ${selfname} ai" ) " != " 0" ]; then
61
+ fn_print_dots " Checking for installer: "
39
62
fn_print_checking_eol
40
- fn_script_log_info " Checking active updates : CHECKING"
41
- fn_print_error_nl " Checking active updates: SteamCMD is currently checking for updates : "
42
- fn_print_error_eol
43
- fn_script_log_error " Checking active updates: SteamCMD is currently checking for updates: ERROR "
63
+ fn_script_log_info " Checking for installer : CHECKING"
64
+ fn_print_info_nl " Checking for installer: LinuxGSM is currently installing : "
65
+ fn_print_info_eol
66
+ fn_script_log_pass " Checking for installer: LinuxGSM is currently installing "
44
67
core_exit.sh
45
68
fi
46
69
}
47
70
71
+ fn_monitor_check_update () {
72
+ # Monitor will check if an update is running.
73
+ if [ " $( pgrep -fc " ${selfname} update" ) " != " 0" ] || [ " $( pgrep -fc " ${selfname} u" ) " != " 0" ] || [ " $( pgrep -fc " ${selfname} validate" ) " != " 0" ] || [ " $( pgrep -fc " ${selfname} v" ) " != " 0" ]; then
74
+ # Specific check for docker. Will ignore the command watch -n 1800 ./csgoserver update
75
+ if [ " $( pgrep -fc " n*${selfname} update" ) " != " 0" ]; then
76
+ fn_print_dots " Checking active updates: "
77
+ fn_print_checking_eol
78
+ fn_script_log_info " Checking active updates: CHECKING"
79
+ fn_print_info_nl " Checking active updates: SteamCMD is currently checking for updates: "
80
+ fn_print_info_eol
81
+ fn_script_log_pass " Checking active updates: SteamCMD is currently checking for updates"
82
+ core_exit.sh
83
+ fi
84
+ fi
85
+ }
86
+
48
87
fn_monitor_check_session () {
49
88
fn_print_dots " Checking session: "
50
89
fn_print_checking_eol
@@ -223,13 +262,14 @@ fn_monitor_loop() {
223
262
}
224
263
225
264
monitorflag=1
265
+ # Dont do any monitoring or checks if installer is running.
266
+ fn_monitor_check_install
226
267
check.sh
227
268
core_logs.sh
228
269
info_game.sh
229
270
230
271
# query pre-checks
231
272
fn_monitor_check_lockfile
232
- fn_monitor_check_update
233
273
fn_monitor_check_session
234
274
# Monitor will not continue if session only check.
235
275
if [ " ${querymode} " != " 1" ]; then
0 commit comments