Selaa lähdekoodia

Final updates

Daniel Gibbs 10 vuotta sitten
vanhempi
commit
91bd2749d8
2 muutettua tiedostoa jossa 16 lisäystä ja 11 poistoa
  1. 13 10
      tests/tests_jc2server.sh
  2. 3 1
      tests/tests_ts3server.sh

+ 13 - 10
tests/tests_jc2server.sh

@@ -3,7 +3,7 @@
 # Server Management Script
 # Server Management Script
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
-version="011115"
+version="071115"
 
 
 #### Variables ####
 #### Variables ####
 
 
@@ -87,15 +87,19 @@ fn_runfunction
 
 
 fn_functions
 fn_functions
 
 
-fn_currentstatus(){
-if [ "${gamename}" == "Teamspeak 3" ]; then
-	fn_check_ts3status
-	ts3status=$(${executable} status servercfgfullpathfile=${servercfgfullpath})
+fn_currentstatus_tmux(){
+pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
+if [ "${pid}" != "0" ]; then
+	currentstatus="ONLINE"
 else
 else
-	pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
+	currentstatus="OFFLINE"	
 fi
 fi
+}
 
 
-if [ "${pid}" != "0" ]||[ "${ts3status}" == "Server is running" ]; then
+fn_currentstatus_ts3(){
+ts3status=$(${executable} status servercfgfullpathfile=${servercfgfullpath})
+
+if [ "${ts3status}" == "Server is running" ]; then
 	currentstatus="ONLINE"
 	currentstatus="ONLINE"
 else
 else
 	currentstatus="OFFLINE"	
 	currentstatus="OFFLINE"	
@@ -103,15 +107,14 @@ fi
 }
 }
 	
 	
 fn_setstatus(){
 fn_setstatus(){
-	fn_currentstatus
-	
+	fn_currentstatus_tmux
 	echo""
 	echo""
 	echo "Required status: ${requiredstatus}"
 	echo "Required status: ${requiredstatus}"
 	counter=0
 	counter=0
 	echo "Current status:  ${currentstatus}"
 	echo "Current status:  ${currentstatus}"
     while [  "${requiredstatus}" != "${currentstatus}" ]; do
     while [  "${requiredstatus}" != "${currentstatus}" ]; do
     	counter=$((counter+1))
     	counter=$((counter+1))
-    	fn_currentstatus
+    	fn_currentstatus_tmux
 		echo -ne "New status:  ${currentstatus}\\r"
 		echo -ne "New status:  ${currentstatus}\\r"
     	
     	
 		if [ "${requiredstatus}" == "ONLINE" ]; then
 		if [ "${requiredstatus}" == "ONLINE" ]; then

+ 3 - 1
tests/tests_ts3server.sh

@@ -3,7 +3,7 @@
 # Server Management Script
 # Server Management Script
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
-version="011115"
+version="071115"
 
 
 #### Variables ####
 #### Variables ####
 
 
@@ -349,6 +349,8 @@ echo "Server Tests - Complete!"
 echo "Using: ${gamename}"
 echo "Using: ${gamename}"
 echo "================================="
 echo "================================="
 echo ""
 echo ""
+requiredstatus="OFFLINE"
+fn_setstatus
 sleep 1
 sleep 1
 fn_printinfo "Tidying up directories."
 fn_printinfo "Tidying up directories."
 sleep 1
 sleep 1