|
|
@ -50,6 +50,9 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|
|
|
# Start Variables |
|
|
|
defaultmap="KF-BioticsLab.rom" |
|
|
|
parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini=${ini} log=${logfile}" |
|
|
|
# Example Parameters for Objective mode |
|
|
|
#defaultmap="KFO-Steamland" |
|
|
|
#parms="server ${defaultmap}?Game=KFStoryGame.KFStoryGame?VACSecured=true -nohomedir ini=${ini} log=${logfile}" |
|
|
|
|
|
|
|
##### Script ##### |
|
|
|
# Do not edit |
|
|
@ -71,7 +74,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" |
|
|
@ -225,7 +228,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} |
|
|
@ -265,7 +268,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 |
|
|
@ -508,7 +511,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 +540,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} |
|
|
|