Răsfoiți Sursa

Resolved issue reversed if

Daniel Gibbs 10 ani în urmă
părinte
comite
826843bdca
1 a modificat fișierele cu 4 adăugiri și 7 ștergeri
  1. 4 7
      tests/tests_jc2server.sh

+ 4 - 7
tests/tests_jc2server.sh

@@ -95,12 +95,10 @@ else
 	pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
 fi
 
-pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
-echo "PID: ${pid}"
-if [ "${pid}" == "0" ]; then
-	currentstatus="OFFLINE"
-else
+if [ "${pid}" != "0" ]||[ "${ts3status}" == "Server is running" ]; then
 	currentstatus="ONLINE"
+else
+	currentstatus="OFFLINE"	
 fi
 }
 	
@@ -114,11 +112,10 @@ fn_setstatus(){
     while [  "${requiredstatus}" != "${currentstatus}" ]; do
     	counter=$((counter+1))
     	fn_currentstatus
-    	echo "REQ: ${requiredstatus} CUR:${currentstatus}"
 		echo -ne "New status:  ${currentstatus}\\r"
     	
 		if [ "${requiredstatus}" == "ONLINE" ]; then
-			(fn_start)
+			(fn_start > /dev/null 2>&1)
 		else
 			(fn_stop > /dev/null 2>&1)
 		fi