소스 검색

Resolved issue reversed if

Daniel Gibbs 10 년 전
부모
커밋
826843bdca
1개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  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