Browse Source

added 2nd query on gsquery to prevent restart

* added 2nd query after delay on gsquery to prevent the script from
restarting during map change
* added +servercfgfile to start parameters to make multiple servers
easier. I will add more documentation on this soon.
pull/63/merge
Daniel Gibbs 11 years ago
parent
commit
f3dd4ef29a
  1. 31
      CounterStrike/csserver
  2. 29
      CounterStrikeConditionZero/csczserver
  3. 31
      CounterStrikeGlobalOffensive/csgoserver
  4. 29
      CounterStrikeSource/cssserver
  5. 31
      DayOfDefeat/dodserver
  6. 31
      DayOfDefeatSource/dodsserver
  7. 31
      HalfLife2Deathmatch/hl2dmserver
  8. 25
      HalfLifeDeathmatchClassic/hldmcserver
  9. BIN
      Insurgency/dependencies/libc.so.6
  10. 33
      Insurgency/insserver
  11. 11
      KillingFloor/kfserver
  12. 34
      Left4Dead2/l4d2server
  13. 11
      NaturalSelection2/ns2server
  14. 31
      NoMoreRoomInHell/nmrihserver
  15. 9
      RedOrchestra/roserver
  16. 31
      TeamFortress2/tf2server
  17. 29
      TeamFortressClassic/tfcserver
  18. 13
      UnrealTournament2004/ut2k4server
  19. 13
      UnrealTournament99/ut99server

31
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -24,7 +24,7 @@ maxplayers="16"
ip="0.0.0.0" ip="0.0.0.0"
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 # https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2
fn_parms(){ fn_parms(){
parms="-game cstrike +map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} -maxplayers ${maxplayers}" parms="-game cstrike +map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} -maxplayers ${maxplayers} +servercfgfile ${servercfg}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -44,14 +44,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/cstrike" systemdir="${filesdir}/cstrike"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./hlds_run" executable="./hlds_run"
servercfg="${systemdir}/${servicename}.cfg" servercfgdir="${systemdir}"
defaultcfg="${systemdir}/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -355,6 +357,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -516,8 +525,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -525,7 +534,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -719,7 +728,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
touch "${systemdir}/listip.cfg" touch "${systemdir}/listip.cfg"
touch "${systemdir}/banned.cfg" touch "${systemdir}/banned.cfg"
{ {
@ -760,7 +769,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

29
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -44,14 +44,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/czero" systemdir="${filesdir}/czero"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./hlds_run" executable="./hlds_run"
servercfg="${systemdir}/${servicename}.cfg" servercfgdir="${systemdir}"
defaultcfg="${systemdir}/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -355,6 +357,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -516,8 +525,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -525,7 +534,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -729,7 +738,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
touch "${systemdir}/listip.cfg" touch "${systemdir}/listip.cfg"
touch "${systemdir}/banned.cfg" touch "${systemdir}/banned.cfg"
{ {
@ -770,7 +779,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

31
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -37,7 +37,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
# https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server # https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server
fn_parms(){ fn_parms(){
parms="-game csgo -usercon +map ${defaultmap} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers}" parms="-game csgo -usercon +map ${defaultmap} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers} +servercfgfile ${servercfg}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -57,14 +57,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/csgo" systemdir="${filesdir}/csgo"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./srcds_run" executable="./srcds_run"
servercfg="${systemdir}/cfg/${servicename}.cfg" servercfgdir="${systemdir}/cfg"
defaultcfg="${systemdir}/cfg/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -368,6 +370,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -529,8 +538,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -538,7 +547,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -701,7 +710,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// server name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
@ -718,7 +727,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

29
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -45,14 +45,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/cstrike" systemdir="${filesdir}/cstrike"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./srcds_run" executable="./srcds_run"
servercfg="${systemdir}/cfg/${servicename}.cfg" servercfgdir="${systemdir}/cfg"
defaultcfg="${systemdir}/cfg/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -517,8 +526,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -526,7 +535,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -689,7 +698,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// server name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
@ -706,7 +715,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

31
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -44,14 +44,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/dod" systemdir="${filesdir}/dod"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./hlds_run" executable="./hlds_run"
servercfg="${systemdir}/${servicename}.cfg" servercfgdir="${systemdir}"
defaultcfg="${systemdir}/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -355,6 +357,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -516,8 +525,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -525,7 +534,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -574,7 +583,7 @@ elif [ ${pass} == 2 ]; then
elif [ ${pass} == 3 ]; then elif [ ${pass} == 3 ]; then
echo "Downloading secondpass appmanifest files. (app 90 fix)" echo "Downloading secondpass appmanifest files. (app 90 fix)"
sleep 2 sleep 2
cd "${appdir}" cd "${appdir}"
rm -f appmanifest_90.acf rm -f appmanifest_90.acf
wget https://raw2.github.com/dgibbs64/linuxgameservers/master/DayOfDefeat/appmanifest/secondpass/appmanifest_90.acf wget https://raw2.github.com/dgibbs64/linuxgameservers/master/DayOfDefeat/appmanifest/secondpass/appmanifest_90.acf
fi fi
@ -730,7 +739,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
touch "${systemdir}/listip.cfg" touch "${systemdir}/listip.cfg"
touch "${systemdir}/banned.cfg" touch "${systemdir}/banned.cfg"
{ {
@ -771,7 +780,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

31
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -25,7 +25,7 @@ maxplayers="16"
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 dod +map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers}" parms="-game dod +map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers} +servercfgfile ${servercfg}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -45,14 +45,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/dod" systemdir="${filesdir}/dod"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./srcds_run" executable="./srcds_run"
servercfg="${systemdir}/cfg/${servicename}.cfg" servercfgdir="${systemdir}/cfg"
defaultcfg="${systemdir}/cfg/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -517,8 +526,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -526,7 +535,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -689,7 +698,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// server name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
@ -706,7 +715,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

31
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -25,7 +25,7 @@ maxplayers="16"
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 hl2mp +map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers}" parms="-game hl2mp +map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers} +servercfgfile ${servercfg}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -45,14 +45,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/hl2mp" systemdir="${filesdir}/hl2mp"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./srcds_run" executable="./srcds_run"
servercfg="${systemdir}/cfg/${servicename}.cfg" servercfgdir="${systemdir}/cfg"
defaultcfg="${systemdir}/cfg/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -517,8 +526,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -526,7 +535,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -689,7 +698,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// server name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
@ -706,7 +715,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

25
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -44,8 +44,10 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/valve" systemdir="${filesdir}/valve"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./hlds_run" executable="./hlds_run"
servercfg="${systemdir}/${servicename}.cfg" servercfgdir="${systemdir}"
defaultcfg="${systemdir}/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
@ -355,6 +357,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -516,8 +525,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -525,7 +534,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -719,7 +728,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
touch "${systemdir}/listip.cfg" touch "${systemdir}/listip.cfg"
touch "${systemdir}/banned.cfg" touch "${systemdir}/banned.cfg"
{ {
@ -760,7 +769,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

BIN
Insurgency/dependencies/libc.so.6

Binary file not shown.

33
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -25,7 +25,7 @@ maxplayers="24"
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="+map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers}" parms="+map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers} +servercfgfile ${servercfg}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -44,15 +44,17 @@ selfname="$0"
filesdir="${rootdir}/serverfiles" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/insurgency" systemdir="${filesdir}/insurgency"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./srcds_linux" executable="./srcds_run"
servercfg="${systemdir}/cfg/${servicename}.cfg" servercfgdir="${systemdir}/cfg"
defaultcfg="${systemdir}/cfg/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -517,8 +526,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -526,7 +535,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -689,7 +698,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// server name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
@ -706,7 +715,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

11
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -349,6 +349,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -564,7 +571,7 @@ echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}" echo "WebAdmin Password: ${webadminpass}"
echo "" echo ""
if [ "${pid}" == "0" ]; then if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else else
echo -e "Status:\e[0;32m ONLINE\e[0;39m" echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi

34
Left4Dead2/l4d2server

@ -3,8 +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: 251214 # Version: 010214
# Version: 240114
#### Variables #### #### Variables ####
@ -22,11 +21,11 @@ defaultmap="c5m1_waterfront"
port="27015" port="27015"
sourcetvport="27020" sourcetvport="27020"
clientport="27005" clientport="27005"
maxplayers="16" maxplayers="8"
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 +map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers}" parms="-game left4dead2 +map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers} +servercfgfile ${servercfg}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -46,14 +45,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/left4dead2" systemdir="${filesdir}/left4dead2"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./srcds_run" executable="./srcds_run"
servercfg="${systemdir}/cfg/${servicename}.cfg" servercfgdir="${systemdir}/cfg"
defaultcfg="${systemdir}/cfg/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -357,6 +358,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -518,8 +526,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -527,7 +535,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -690,7 +698,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// server name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
@ -707,7 +715,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

11
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -352,6 +352,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -540,7 +547,7 @@ echo "You can change various parameters by editing the"
echo "start parameters in ${selfname}" echo "start parameters in ${selfname}"
echo "" echo ""
if [ "${pid}" == "0" ]; then if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else else
echo -e "Status:\e[0;32m ONLINE\e[0;39m" echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi

31
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -25,7 +25,7 @@ maxplayers="8"
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="+map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers}" parms="+map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers} +servercfgfile ${servercfg}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -45,14 +45,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/nmrih" systemdir="${filesdir}/nmrih"
executabledir="${filesdir}/srcds" executabledir="${filesdir}/srcds"
executable="./srcds_nmrih" executable="./srcds_nmrih"
servercfg="${systemdir}/cfg/${servicename}.cfg" servercfgdir="${systemdir}/cfg"
defaultcfg="${systemdir}/cfg/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -517,8 +526,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -526,7 +535,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -700,7 +709,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// server name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
@ -717,7 +726,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

9
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -345,6 +345,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"

31
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -25,7 +25,7 @@ maxplayers="16"
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 tf +map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers}" parms="-game tf +map ${defaultmap} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -maxplayers ${maxplayers} +servercfgfile ${servercfg}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -45,14 +45,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/tf" systemdir="${filesdir}/tf"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./srcds_run" executable="./srcds_run"
servercfg="${systemdir}/cfg/${servicename}.cfg" servercfgdir="${systemdir}/cfg"
defaultcfg="${systemdir}/cfg/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -517,8 +526,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -526,7 +535,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -689,7 +698,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// server name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
@ -706,7 +715,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

29
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -44,14 +44,16 @@ filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/tfc" systemdir="${filesdir}/tfc"
executabledir="${filesdir}" executabledir="${filesdir}"
executable="./hlds_run" executable="./hlds_run"
servercfg="${systemdir}/${servicename}.cfg" servercfgdir="${systemdir}"
defaultcfg="${systemdir}/server.cfg" servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so" steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
# Logging # Logging
logdays="7" logdays="7"
@ -355,6 +357,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -516,8 +525,8 @@ echo -en "\n"
fn_details(){ fn_details(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
@ -525,7 +534,7 @@ echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}" echo "RCON password: ${rcon}"
echo "Config file: ${servercfg}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "${servername} Ports" echo "${servername} Ports"
echo "============================" echo "============================"
@ -729,7 +738,7 @@ echo "================================="
echo "exec ${servicename}.cfg" > "${defaultcfg}" echo "exec ${servicename}.cfg" > "${defaultcfg}"
sleep 1 sleep 1
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfg}" touch "${servercfgfullpath}"
touch "${systemdir}/listip.cfg" touch "${systemdir}/listip.cfg"
touch "${systemdir}/banned.cfg" touch "${systemdir}/banned.cfg"
{ {
@ -770,7 +779,7 @@ echo "================================="
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
}|tee "${servercfg}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header

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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -344,6 +344,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -552,7 +559,7 @@ echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}" echo "WebAdmin Password: ${webadminpass}"
echo "" echo ""
if [ "${pid}" == "0" ]; then if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else else
echo -e "Status:\e[0;32m ONLINE\e[0;39m" echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
@ -717,7 +724,7 @@ echo ""
fn_utloginstall(){ fn_utloginstall(){
echo "Creating log directorys" echo "Creating log directorys"
echo "=================================" echo "================================="
sleep 1 sleep 1
mkdir -pv "${rootdir}/log" mkdir -pv "${rootdir}/log"
mkdir -pv "${scriptlogdir}" mkdir -pv "${scriptlogdir}"
touch "${scriptlog}" touch "${scriptlog}"

13
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: 240114 # Version: 010214
#### Variables #### #### Variables ####
@ -338,6 +338,13 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}"
sleep 1 sleep 1
echo -en "\n" echo -en "\n"
if [[ -z "${secondquery}" ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] Monitoring ${servicename}: Waiting 30 seconds to re-query"
fn_scriptlog "Waiting 30 seconds to re-query"
sleep 30
secondquery=1
fn_serverquery
fi
if [ "${emailnotification}" = "on" ]; then if [ "${emailnotification}" = "on" ]; then
subject="${servicename} Monitor - Starting ${servername}" subject="${servicename} Monitor - Starting ${servername}"
failurereason="Failed to query ${servicename}: ${serverquery}" failurereason="Failed to query ${servicename}: ${serverquery}"
@ -541,7 +548,7 @@ echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}" echo "WebAdmin Password: ${webadminpass}"
echo "" echo ""
if [ "${pid}" == "0" ]; then if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else else
echo -e "Status:\e[0;32m ONLINE\e[0;39m" echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
@ -687,7 +694,7 @@ echo ""
fn_utloginstall(){ fn_utloginstall(){
echo "Creating log directorys" echo "Creating log directorys"
echo "=================================" echo "================================="
sleep 1 sleep 1
mkdir -pv "${rootdir}/log" mkdir -pv "${rootdir}/log"
mkdir -pv "${scriptlogdir}" mkdir -pv "${scriptlogdir}"
touch "${scriptlog}" touch "${scriptlog}"

Loading…
Cancel
Save