Browse Source

Monitor no longer starts server if stop used

If the administrator stops the server using the stop command the monitor
will disable itself preventing the server from starting back up on its
own
pull/103/head
Daniel Gibbs 11 years ago
parent
commit
6b120e2e6c
  1. 15
      CounterStrike/csserver
  2. 15
      CounterStrikeConditionZero/csczserver
  3. 15
      CounterStrikeGlobalOffensive/csgoserver
  4. 15
      CounterStrikeSource/cssserver
  5. 15
      DayOfDefeat/dodserver
  6. 15
      DayOfDefeatSource/dodsserver
  7. 17
      GarrysMod/gmodserver
  8. 18
      HalfLife2Deathmatch/hl2dmserver
  9. 15
      HalfLifeDeathmatchClassic/hldmcserver
  10. 17
      Insurgency/insserver
  11. 13
      KillingFloor/kfserver
  12. 18
      Left4Dead2/l4d2server
  13. 15
      NaturalSelection2/ns2server
  14. 17
      NoMoreRoomInHell/nmrihserver
  15. 13
      RedOrchestra/roserver
  16. 15
      TeamFortress2/tf2server
  17. 15
      TeamFortressClassic/tfcserver
  18. 13
      UnrealTournament2004/ut2k4server
  19. 12
      UnrealTournament99/ut99server

15
CounterStrike/csserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -41,6 +41,7 @@ engine="goldsource"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/cstrike" systemdir="${filesdir}/cstrike"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -465,6 +466,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -558,6 +565,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -583,6 +592,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -617,7 +628,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

15
CounterStrikeConditionZero/csczserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -41,6 +41,7 @@ engine="goldsource"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/czero" systemdir="${filesdir}/czero"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -465,6 +466,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -558,6 +565,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -583,6 +592,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -617,7 +628,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

15
CounterStrikeGlobalOffensive/csgoserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -59,6 +59,7 @@ engine="source"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/csgo" systemdir="${filesdir}/csgo"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -484,6 +485,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -577,6 +584,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -603,6 +612,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -637,7 +648,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

15
CounterStrikeSource/cssserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -42,6 +42,7 @@ engine="source"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/cstrike" systemdir="${filesdir}/cstrike"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -466,6 +467,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -559,6 +566,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -584,6 +593,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -618,7 +629,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

15
DayOfDefeat/dodserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -41,6 +41,7 @@ engine="goldsource"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/dod" systemdir="${filesdir}/dod"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -465,6 +466,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -558,6 +565,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -583,6 +592,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -617,7 +628,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

15
DayOfDefeatSource/dodsserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -42,6 +42,7 @@ engine="source"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/dod" systemdir="${filesdir}/dod"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -466,6 +467,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -559,6 +566,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -584,6 +593,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -618,7 +629,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

17
GarrysMod/gmodserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 190614 # Version: 220614
#### Variables #### #### Variables ####
@ -22,7 +22,6 @@ maxplayers="16"
port="27015" port="27015"
sourcetvport="27020" sourcetvport="27020"
clientport="27005" clientport="27005"
ip="0.0.0.0" ip="0.0.0.0"
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
@ -35,7 +34,6 @@ parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} +clientport ${cli
# Steam # Steam
appid="4020" appid="4020"
# Server Details # Server Details
servicename="gmod-server" servicename="gmod-server"
gamename="Garrys's Mod" gamename="Garrys's Mod"
@ -44,6 +42,7 @@ engine="source"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/garrysmod" systemdir="${filesdir}/garrysmod"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -468,6 +467,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -561,6 +566,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -586,6 +593,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -620,7 +629,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

18
HalfLife2Deathmatch/hl2dmserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -19,7 +19,6 @@ steampass=""
# Start Variables # Start Variables
defaultmap="dm_lockdown" defaultmap="dm_lockdown"
maxplayers="16" maxplayers="16"
tickrate="64"
port="27015" port="27015"
sourcetvport="27020" sourcetvport="27020"
clientport="27005" clientport="27005"
@ -27,7 +26,7 @@ ip="0.0.0.0"
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
fn_parms(){ fn_parms(){
parms="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" parms="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -43,6 +42,7 @@ engine="source"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/hl2mp" systemdir="${filesdir}/hl2mp"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -467,6 +467,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -560,6 +566,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -585,6 +593,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -619,7 +629,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

15
HalfLifeDeathmatchClassic/hldmcserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -41,6 +41,7 @@ engine="goldsource"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/valve" systemdir="${filesdir}/valve"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -465,6 +466,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -558,6 +565,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -583,6 +592,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -617,7 +628,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

17
Insurgency/insserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -26,7 +26,7 @@ ip="0.0.0.0"
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
fn_parms(){ fn_parms(){
parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" parms="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -42,6 +42,7 @@ engine="source"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/insurgency" systemdir="${filesdir}/insurgency"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -466,6 +467,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -559,6 +566,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -584,6 +593,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -618,7 +629,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

13
KillingFloor/kfserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -22,6 +22,7 @@ appid="215360"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/System" systemdir="${filesdir}/System"
executabledir="${systemdir}" executabledir="${systemdir}"
@ -456,6 +457,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -549,6 +556,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -574,6 +583,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1

18
Left4Dead2/l4d2server

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -20,13 +20,12 @@ steampass=""
defaultmap="c5m1_waterfront" defaultmap="c5m1_waterfront"
maxplayers="8" maxplayers="8"
port="27015" port="27015"
sourcetvport="27020"
clientport="27005" clientport="27005"
ip="0.0.0.0" ip="0.0.0.0"
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
fn_parms(){ fn_parms(){
parms="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" parms="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -42,6 +41,7 @@ engine="source"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/left4dead2" systemdir="${filesdir}/left4dead2"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -466,6 +466,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -559,6 +565,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -584,6 +592,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -618,7 +628,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

15
NaturalSelection2/ns2server

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -45,6 +45,7 @@ engine="spark"
# Directories # Directories
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}" systemdir="${filesdir}"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -359,7 +360,7 @@ if [ ! -z "${gamelogdir}" ]; then
echo -e "\n\nServer log\n====================\n" >> "${emaillog}" echo -e "\n\nServer log\n====================\n" >> "${emaillog}"
tail "${gamelogdir}"/*|grep -v "==>"|sed '/^$/d'|tail -25 >> "${emaillog}" tail "${gamelogdir}"/*|grep -v "==>"|sed '/^$/d'|tail -25 >> "${emaillog}"
fi fi
cat -v "${emaillog}" | mail -s "${subject}" ${email} mail -s "${subject}" ${email} < "${emaillog}"
fn_printinfo "Sent email notification to ${email}" fn_printinfo "Sent email notification to ${email}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
@ -461,6 +462,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -554,6 +561,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -579,6 +588,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1

17
NoMoreRoomInHell/nmrihserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -20,13 +20,12 @@ steampass="password"
defaultmap="nmo_broadway" defaultmap="nmo_broadway"
maxplayers="8" maxplayers="8"
port="27015" port="27015"
sourcetvport="27020"
clientport="27005" clientport="27005"
ip="0.0.0.0" ip="0.0.0.0"
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
fn_parms(){ fn_parms(){
parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -466,6 +465,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -559,6 +564,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -584,6 +591,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -618,7 +627,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

13
RedOrchestra/roserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -22,6 +22,7 @@ appid="223250"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/system" systemdir="${filesdir}/system"
executabledir="${systemdir}" executabledir="${systemdir}"
@ -452,6 +453,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -545,6 +552,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -570,6 +579,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1

15
TeamFortress2/tf2server

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -42,6 +42,7 @@ engine="source"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/tf" systemdir="${filesdir}/tf"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -466,6 +467,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -559,6 +566,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -584,6 +593,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -618,7 +629,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

15
TeamFortressClassic/tfcserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -41,6 +41,7 @@ engine="goldsource"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/tfc" systemdir="${filesdir}/tfc"
executabledir="${filesdir}" executabledir="${filesdir}"
@ -465,6 +466,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -558,6 +565,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -583,6 +592,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1
@ -617,7 +628,7 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ "${engine}" = "source" ]; then if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}" echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" echo "OUTBOUND Client port ${clientport}"

13
UnrealTournament2004/ut2k4server

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -15,6 +15,7 @@ email="[email protected]"
# Directorys # Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
lockselfname=$(echo "${selfname}.lock"|sed 's/^\(.\{1\}\).\(.*\)/\1\2/')
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/System" systemdir="${filesdir}/System"
executabledir="${systemdir}" executabledir="${systemdir}"
@ -445,6 +446,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -506,6 +513,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -531,6 +540,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1

12
UnrealTournament99/ut99server

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 050214 # Version: 220614
#### Variables #### #### Variables ####
@ -445,6 +445,12 @@ fn_monitorserver(){
fn_rootcheck fn_rootcheck
fn_syscheck fn_syscheck
fn_autoip fn_autoip
if [ ! -f ${lockselfname} ]; then
fn_printinfo "Monitoring ${servicename}: No lock file found: Monitor disabled"
sleep 1
echo -en "\n"
exit
fi
fn_printdots "Monitoring ${servicename}: ${servername}" fn_printdots "Monitoring ${servicename}: ${servername}"
sleep 1 sleep 1
fn_scriptlog "Monitoring ${servername}" fn_scriptlog "Monitoring ${servername}"
@ -506,6 +512,8 @@ else
fn_printok "Stopping ${servicename}: ${servername}" fn_printok "Stopping ${servicename}: ${servername}"
fn_scriptlog "Stopped ${servername}" fn_scriptlog "Stopped ${servername}"
fi fi
# Remove lock file
rm -f ${lockselfname}
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
} }
@ -531,6 +539,8 @@ if [ ${tmuxwc} -eq 1 ]; then
fn_scriptlog "${servername} is already running" fn_scriptlog "${servername} is already running"
exit exit
fi fi
# Create lock file
lockfile -r 0 ${lockselfname}
cd "${executabledir}" cd "${executabledir}"
tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'" tmux new-session -d -s ${servicename} "${executable} ${parms}|tee -a '${consolelog}'"
sleep 1 sleep 1

Loading…
Cancel
Save