Kaynağa Gözat

Added fn_tmuxcheck for all the special people

Added fn_tmuxcheck for all the special people who do not know how to
RTFM or use Google then leave a comment asking what 'tmux: command not
found means' I'm not bitter...honest!
Daniel Gibbs 11 yıl önce
ebeveyn
işleme
0551d421f0

+ 1 - 0
functions/fn_console

@@ -26,6 +26,7 @@ esac
 done
 fn_printdots "Starting"
 sleep 1
+fn_tmuxcheck
 tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
 if [ "${tmuxwc}" -eq 1 ]; then
 	fn_printoknl "Starting"

+ 5 - 0
functions/fn_functions

@@ -99,6 +99,11 @@ functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
+fn_tmuxcheck(){
+functionfile="${FUNCNAME}"
+fn_runfunction
+}
+
 fn_unreal2compressmaps(){
 functionfile="${FUNCNAME}"
 fn_runfunction

+ 6 - 4
functions/fn_startserver

@@ -6,7 +6,7 @@
 
 # Description: Starts the server.
 
-modulename="Starting"
+local modulename="Starting"
 fn_rootcheck
 fn_syscheck
 fn_autoip
@@ -16,6 +16,10 @@ if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
 fi
 fn_parms
 fn_logmanager
+fn_printdots "${servername}"
+fn_scriptlog "${servername}"
+fn_tmuxcheck
+sleep 1
 tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
 if [ "${tmuxwc}" -eq 0 ]; then
 	fn_scriptlog "Rotating log files"
@@ -25,9 +29,7 @@ if [ "${tmuxwc}" -eq 0 ]; then
 	mv "${scriptlog}" "${scriptlogdate}"
 	mv "${consolelog}" "${consolelogdate}"
 fi
-fn_printdots "${servername}"
-fn_scriptlog "${servername}"
-sleep 1
+
 if [ "${tmuxwc}" -eq 1 ]; then
 	fn_printinfo "${servername} is already running"
 	fn_scriptlog "${servername} is already running"

+ 3 - 2
functions/fn_stopserver

@@ -6,13 +6,14 @@
 
 # Description: Stops the server.
 
-modulename="Stopping"
+local modulename="Stopping"
 fn_rootcheck
 fn_syscheck
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:")
 fn_printdots "${servername}"
 fn_scriptlog "${servername}"
 sleep 1
+fn_tmuxcheck
+pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:")
 if [ "${pid}" == "0" ]; then
 	fn_printfail "${servername} is already stopped"
 	fn_scriptlog "${servername} is already stopped"