Просмотр исходного кода

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 лет назад
Родитель
Сommit
0551d421f0
4 измененных файлов с 15 добавлено и 6 удалено
  1. 1 0
      functions/fn_console
  2. 5 0
      functions/fn_functions
  3. 6 4
      functions/fn_startserver
  4. 3 2
      functions/fn_stopserver

+ 1 - 0
functions/fn_console

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

+ 5 - 0
functions/fn_functions

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

+ 6 - 4
functions/fn_startserver

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

+ 3 - 2
functions/fn_stopserver

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