Browse Source

improved accuracy of tmux session detection

Also added grep -E "^${servicename}:" for more accurate detection of the
tmux session
pull/30/head
Daniel Gibbs 12 years ago
parent
commit
76bfaba05c
  1. 4
      CounterStrike/csserver
  2. 10
      CounterStrikeSource/cssserver
  3. 10
      DayOfDefeatSource/dodsserver
  4. 10
      HalfLife2Deathmatch/hl2dmserver
  5. 10
      Left4Dead2/l4d2server
  6. 10
      Mumble/mumbleserver
  7. 10
      NaturalSelection2/ns2server
  8. 10
      NoMoreRoomInHell/nmrihserver
  9. 10
      RedOrchestra/roserver
  10. 10
      TeamFortress2/tf2server
  11. 12
      TheHiddenSource/thsserver
  12. 10
      UnrealTournament2004/ut2k4server
  13. 10
      UnrealTournament99/ut99server

4
CounterStrike/csserver

@ -21,7 +21,7 @@ parms="-game cstrike +map ${defaultmap} -strictportbind -port ${port} +clientpor
#### Advanced Variables ####
# Steam
appid="90"
appid="90 -beta beta"
# Server Details
servicename="cs-server"
@ -536,6 +536,8 @@ echo "================================="
echo "app_update ${appid} validate" >> install.txt
echo "quit" >> install.txt
STEAMEXE=steamcmd ./steam.sh +runscript install.txt
STEAMEXE=steamcmd ./steam.sh +runscript install.txt
STEAMEXE=steamcmd ./steam.sh +runscript install.txt
rm install.txt
echo ""
echo "================================="

10
CounterStrikeSource/cssserver

@ -73,7 +73,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -158,7 +158,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -198,7 +198,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -411,7 +411,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -440,7 +440,7 @@ mv ${consolelog} ${consolelogdate}
cd ${filesdir}
tmux new-session -d -s ${servicename} "./srcds_run ${parms} |tee -a ${consolelog}"
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

10
DayOfDefeatSource/dodsserver

@ -72,7 +72,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -157,7 +157,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -197,7 +197,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -410,7 +410,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -439,7 +439,7 @@ mv ${consolelog} ${consolelogdate}
cd ${filesdir}
tmux new-session -d -s ${servicename} "./srcds_run ${parms} |tee -a ${consolelog}"
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

10
HalfLife2Deathmatch/hl2dmserver

@ -73,7 +73,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -158,7 +158,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -198,7 +198,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -411,7 +411,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -440,7 +440,7 @@ mv ${consolelog} ${consolelogdate}
cd ${filesdir}
tmux new-session -d -s ${servicename} "./srcds_run ${parms} |tee -a ${consolelog}"
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

10
Left4Dead2/l4d2server

@ -73,7 +73,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -158,7 +158,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -198,7 +198,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -411,7 +411,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -440,7 +440,7 @@ mv ${consolelog} ${consolelogdate}
cd ${filesdir}
tmux new-session -d -s ${servicename} "./srcds_run ${parms} |tee -a ${consolelog}"
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

10
Mumble/mumbleserver

@ -50,7 +50,7 @@ fi
fn_runcheck(){
# already running check
pidwc=$(screen -ls |grep ${servicename} |awk -F . '{print $1}'|awk '{print $1}'|wc -l)
pidwc=$(screen -ls |grep -E "^${servicename}:" |awk -F . '{print $1}'|awk '{print $1}'|wc -l)
if [ ${pidwc} -eq 1 ];then
echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} is already running" >> ${logfile}
@ -93,7 +93,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
pidwc=$(screen -ls |grep ${servicename} |awk -F . '{print $1}'|awk '{print $1}'|wc -l)
pidwc=$(screen -ls |grep -E "^${servicename}:" |awk -F . '{print $1}'|awk '{print $1}'|wc -l)
if [ ${pidwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -229,7 +229,7 @@ echo -e "[\e[0;32m OK \e[0;39m] Starting ${servicename}: ${servername}"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Starting ${servername}" >> ${logfile}
screen -d -m -S ${servicename} ./murmur.x86 -fg -ini ${ini}
sleep 1
pidwc=$(screen -ls |grep ${servicename} |awk -F . '{print $1}'|awk '{print $1}'|wc -l)
pidwc=$(screen -ls |grep -E "^${servicename}:" |awk -F . '{print $1}'|awk '{print $1}'|wc -l)
if [ ${pidwc} -eq 0 ];then
echo -e "[\e[0;31m FAIL \e[0;39m] ${servicename}: ${servername} failed to start"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} failed to start" >> ${logfile}
@ -239,14 +239,14 @@ fi
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(screen -ls |grep ${servicename} |awk -F . '{print $1}'|awk '{print $1}')
pid=$(screen -ls |grep -E "^${servicename}:" |awk -F . '{print $1}'|awk '{print $1}')
if [ -z ${pid} ];then
echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already stopped"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} is already stopped" >> ${logfile}
else
echo -e "[\e[0;32m OK \e[0;39m] Stopping ${servicename}: ${servername}"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${logfile}
pkill -P `screen -ls |grep ${servicename} |awk -F . '{print $1}'|awk '{print $1}'`
pkill -P `screen -ls |grep -E "^${servicename}:" |awk -F . '{print $1}'|awk '{print $1}'`
screen -wipe > /dev/null 2>&1
fi
}

10
NaturalSelection2/ns2server

@ -77,7 +77,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -162,7 +162,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -202,7 +202,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -408,7 +408,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -437,7 +437,7 @@ mv ${consolelog} ${consolelogdate}
cd ${filesdir}
tmux new-session -d -s ${servicename} "./server_linux32 ${parms} |tee -a ${consolelog}"
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

10
NoMoreRoomInHell/nmrihserver

@ -77,7 +77,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -162,7 +162,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -202,7 +202,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -415,7 +415,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -444,7 +444,7 @@ mv ${consolelog} ${consolelogdate}
cd ${filesdir}/srcds
tmux new-session -d -s ${servicename} "./srcds_nmrih ${parms} -debug|tee -a ${consolelog}"
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

10
RedOrchestra/roserver

@ -70,7 +70,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -224,7 +224,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -264,7 +264,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -507,7 +507,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -537,7 +537,7 @@ cd ${systemdir}
tmux new-session -d -s ${servicename} "./ucc-bin ${parms} |tee -a ${consolelog}"
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

10
TeamFortress2/tf2server

@ -73,7 +73,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -158,7 +158,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -198,7 +198,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -411,7 +411,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -440,7 +440,7 @@ mv ${consolelog} ${consolelogdate}
cd ${filesdir}
tmux new-session -d -s ${servicename} "./srcds_run ${parms} |tee -a ${consolelog}"
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

12
TheHiddenSource/thsserver

@ -70,7 +70,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -155,7 +155,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -195,7 +195,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -242,7 +242,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -455,7 +455,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -484,7 +484,7 @@ mv ${consolelog} ${consolelogdate}
cd ${filesdir}
tmux new-session -d -s ${servicename} "./srcds_run ${parms} |tee -a ${consolelog}"
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

10
UnrealTournament2004/ut2k4server

@ -63,7 +63,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -188,7 +188,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -228,7 +228,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -454,7 +454,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -488,7 +488,7 @@ else
tmux new-session -d -s ${servicename} "./ucc-bin ${parms} |tee -a ${consolelog}"
fi
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

10
UnrealTournament99/ut99server

@ -63,7 +63,7 @@ fi
}
fn_runcheck(){
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
fn_serverquery
echo -en "\r[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} is already running"
@ -178,7 +178,7 @@ esac
done
echo -en "\r[ .... ] Starting ${servicename} console"
sleep 0.5
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\r[\e[0;32m OK \e[0;39m] Starting ${servicename} console"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${servername} console accessed" >> ${scriptlog}
@ -218,7 +218,7 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 1 ];then
echo -e "\e[0;31mWARNING!\e[0;39m ${servicename} is currently running"
while true; do
@ -444,7 +444,7 @@ fn_startserver
fn_stopserver(){
fn_rootcheck
fn_syscheck
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo -en "[ .... ] Stopping ${servicename}: ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: Stopping ${servername}" >> ${scriptlog}
sleep 0.5
@ -473,7 +473,7 @@ mv ${consolelog} ${consolelogdate}
cd ${systemdir}
tmux new-session -d -s ${servicename} "./ucc-bin ${parms} |tee -a ${consolelog}"
sleep 1
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep ${servicename}|wc -l)
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
if [ ${tmuxwc} -eq 0 ];then
echo -en "\r[\e[0;31m FAIL \e[0;39m] Starting ${servicename}: Failed to start ${servername}"
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: failed to start ${servername}" >> ${scriptlog}

Loading…
Cancel
Save