Browse Source

seporated tmux and ts3 code

pull/528/head
Daniel Gibbs 10 years ago
parent
commit
660480187a
  1. 23
      tests/tests_ts3server.sh

23
tests/tests_ts3server.sh

@ -70,15 +70,19 @@ fn_runfunction
fn_functions fn_functions
fn_currentstatus(){ fn_currentstatus_tmux(){
if [ "${gamename}" == "Teamspeak 3" ]; then pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
fn_check_ts3status if [ "${pid}" != "0" ]; then
ts3status=$(${executable} status servercfgfullpathfile=${servercfgfullpath}) currentstatus="ONLINE"
else else
pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") currentstatus="OFFLINE"
fi fi
echo "TS3STATUS: ${ts3status}" }
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"
@ -86,15 +90,14 @@ fi
} }
fn_setstatus(){ fn_setstatus(){
fn_currentstatus fn_currentstatus_ts3
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_ts3
echo -ne "New status: ${currentstatus}\\r" echo -ne "New status: ${currentstatus}\\r"
if [ "${requiredstatus}" == "ONLINE" ]; then if [ "${requiredstatus}" == "ONLINE" ]; then

Loading…
Cancel
Save