diff --git a/CounterStrike/csserver b/CounterStrike/csserver index baba4e71f..f7a961de8 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -24,7 +24,7 @@ maxplayers="16" ip="0.0.0.0" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 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 #### @@ -44,14 +44,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/cstrike" executabledir="${filesdir}" executable="./hlds_run" -servercfg="${systemdir}/${servicename}.cfg" -defaultcfg="${systemdir}/server.cfg" +servercfgdir="${systemdir}" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -355,6 +357,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -516,8 +525,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -525,7 +534,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -719,7 +728,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" touch "${systemdir}/listip.cfg" touch "${systemdir}/banned.cfg" { @@ -760,7 +769,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index 958b28cab..c19e17f46 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -44,14 +44,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/czero" executabledir="${filesdir}" executable="./hlds_run" -servercfg="${systemdir}/${servicename}.cfg" -defaultcfg="${systemdir}/server.cfg" +servercfgdir="${systemdir}" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -355,6 +357,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -516,8 +525,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -525,7 +534,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -729,7 +738,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" touch "${systemdir}/listip.cfg" touch "${systemdir}/banned.cfg" { @@ -770,7 +779,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index a69aab35b..f401e3608 100644 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### 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/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server 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 #### @@ -57,14 +57,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/csgo" executabledir="${filesdir}" executable="./srcds_run" -servercfg="${systemdir}/cfg/${servicename}.cfg" -defaultcfg="${systemdir}/cfg/server.cfg" +servercfgdir="${systemdir}/cfg" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -368,6 +370,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -529,8 +538,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -538,7 +547,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -701,7 +710,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" { echo -e "// server name" echo -e "hostname \"${servername}\"" @@ -718,7 +727,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver index 8a0217d8b..f1c182ba0 100644 --- a/CounterStrikeSource/cssserver +++ b/CounterStrikeSource/cssserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -45,14 +45,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/cstrike" executabledir="${filesdir}" executable="./srcds_run" -servercfg="${systemdir}/cfg/${servicename}.cfg" -defaultcfg="${systemdir}/cfg/server.cfg" +servercfgdir="${systemdir}/cfg" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -517,8 +526,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -526,7 +535,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -689,7 +698,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" { echo -e "// server name" echo -e "hostname \"${servername}\"" @@ -706,7 +715,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index 27717716b..630323d8a 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -44,14 +44,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dod" executabledir="${filesdir}" executable="./hlds_run" -servercfg="${systemdir}/${servicename}.cfg" -defaultcfg="${systemdir}/server.cfg" +servercfgdir="${systemdir}" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -355,6 +357,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -516,8 +525,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -525,7 +534,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -574,7 +583,7 @@ elif [ ${pass} == 2 ]; then elif [ ${pass} == 3 ]; then echo "Downloading secondpass appmanifest files. (app 90 fix)" sleep 2 - cd "${appdir}" + cd "${appdir}" rm -f appmanifest_90.acf wget https://raw2.github.com/dgibbs64/linuxgameservers/master/DayOfDefeat/appmanifest/secondpass/appmanifest_90.acf fi @@ -730,7 +739,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" touch "${systemdir}/listip.cfg" touch "${systemdir}/banned.cfg" { @@ -771,7 +780,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver index 67a1923a5..16ac19f93 100644 --- a/DayOfDefeatSource/dodsserver +++ b/DayOfDefeatSource/dodsserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -25,7 +25,7 @@ maxplayers="16" ip="0.0.0.0" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server 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 #### @@ -45,14 +45,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dod" executabledir="${filesdir}" executable="./srcds_run" -servercfg="${systemdir}/cfg/${servicename}.cfg" -defaultcfg="${systemdir}/cfg/server.cfg" +servercfgdir="${systemdir}/cfg" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -517,8 +526,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -526,7 +535,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -689,7 +698,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" { echo -e "// server name" echo -e "hostname \"${servername}\"" @@ -706,7 +715,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver index 6880ed28d..1ca9aeba2 100644 --- a/HalfLife2Deathmatch/hl2dmserver +++ b/HalfLife2Deathmatch/hl2dmserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -25,7 +25,7 @@ maxplayers="16" ip="0.0.0.0" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server 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 #### @@ -45,14 +45,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/hl2mp" executabledir="${filesdir}" executable="./srcds_run" -servercfg="${systemdir}/cfg/${servicename}.cfg" -defaultcfg="${systemdir}/cfg/server.cfg" +servercfgdir="${systemdir}/cfg" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -517,8 +526,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -526,7 +535,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -689,7 +698,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" { echo -e "// server name" echo -e "hostname \"${servername}\"" @@ -706,7 +715,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/HalfLifeDeathmatchClassic/hldmcserver b/HalfLifeDeathmatchClassic/hldmcserver index 4b58edadf..133dcd14e 100644 --- a/HalfLifeDeathmatchClassic/hldmcserver +++ b/HalfLifeDeathmatchClassic/hldmcserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -44,8 +44,10 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/valve" executabledir="${filesdir}" executable="./hlds_run" -servercfg="${systemdir}/${servicename}.cfg" -defaultcfg="${systemdir}/server.cfg" +servercfgdir="${systemdir}" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" @@ -355,6 +357,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -516,8 +525,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -525,7 +534,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -719,7 +728,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" touch "${systemdir}/listip.cfg" touch "${systemdir}/banned.cfg" { @@ -760,7 +769,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/Insurgency/dependencies/libc.so.6 b/Insurgency/dependencies/libc.so.6 new file mode 100644 index 000000000..62ea0c1b1 Binary files /dev/null and b/Insurgency/dependencies/libc.so.6 differ diff --git a/Insurgency/insserver b/Insurgency/insserver index a6da7ccff..75241a803 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -25,7 +25,7 @@ maxplayers="24" ip="0.0.0.0" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server 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 #### @@ -44,15 +44,17 @@ selfname="$0" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/insurgency" executabledir="${filesdir}" -executable="./srcds_linux" -servercfg="${systemdir}/cfg/${servicename}.cfg" -defaultcfg="${systemdir}/cfg/server.cfg" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -517,8 +526,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -526,7 +535,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -689,7 +698,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" { echo -e "// server name" echo -e "hostname \"${servername}\"" @@ -706,7 +715,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver index 096adc4ca..fe424b0c8 100644 --- a/KillingFloor/kfserver +++ b/KillingFloor/kfserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -349,6 +349,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -564,7 +571,7 @@ echo "WebAdmin Username: ${webadminuser}" echo "WebAdmin Password: ${webadminpass}" echo "" 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 echo -e "Status:\e[0;32m ONLINE\e[0;39m" fi diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index 88eb50525..423910a4c 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -3,8 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 251214 -# Version: 240114 +# Version: 010214 #### Variables #### @@ -22,11 +21,11 @@ defaultmap="c5m1_waterfront" port="27015" sourcetvport="27020" clientport="27005" -maxplayers="16" +maxplayers="8" ip="0.0.0.0" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server 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 #### @@ -46,14 +45,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/left4dead2" executabledir="${filesdir}" executable="./srcds_run" -servercfg="${systemdir}/cfg/${servicename}.cfg" -defaultcfg="${systemdir}/cfg/server.cfg" +servercfgdir="${systemdir}/cfg" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -357,6 +358,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -518,8 +526,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -527,7 +535,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -690,7 +698,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" { echo -e "// server name" echo -e "hostname \"${servername}\"" @@ -707,7 +715,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server index 1c970b56e..8a715c9ab 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -352,6 +352,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" 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 "" 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 echo -e "Status:\e[0;32m ONLINE\e[0;39m" fi diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index 38a49595b..299f86beb 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -25,7 +25,7 @@ maxplayers="8" ip="0.0.0.0" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server 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 #### @@ -45,14 +45,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/nmrih" executabledir="${filesdir}/srcds" executable="./srcds_nmrih" -servercfg="${systemdir}/cfg/${servicename}.cfg" -defaultcfg="${systemdir}/cfg/server.cfg" +servercfgdir="${systemdir}/cfg" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -517,8 +526,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -526,7 +535,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -700,7 +709,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" { echo -e "// server name" echo -e "hostname \"${servername}\"" @@ -717,7 +726,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver index 54d3c43f5..9ad9dcdf6 100644 --- a/RedOrchestra/roserver +++ b/RedOrchestra/roserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -345,6 +345,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server index 5969375fe..ef16f3daa 100644 --- a/TeamFortress2/tf2server +++ b/TeamFortress2/tf2server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -25,7 +25,7 @@ maxplayers="16" ip="0.0.0.0" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server 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 #### @@ -45,14 +45,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/tf" executabledir="${filesdir}" executable="./srcds_run" -servercfg="${systemdir}/cfg/${servicename}.cfg" -defaultcfg="${systemdir}/cfg/server.cfg" +servercfgdir="${systemdir}/cfg" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -356,6 +358,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -517,8 +526,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -526,7 +535,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -689,7 +698,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" { echo -e "// server name" echo -e "hostname \"${servername}\"" @@ -706,7 +715,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver index 271d0009b..e7a814fc2 100644 --- a/TeamFortressClassic/tfcserver +++ b/TeamFortressClassic/tfcserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -44,14 +44,16 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/tfc" executabledir="${filesdir}" executable="./hlds_run" -servercfg="${systemdir}/${servicename}.cfg" -defaultcfg="${systemdir}/server.cfg" +servercfgdir="${systemdir}" +servercfg="${servicename}.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +defaultcfg="${servercfgdir}/server.cfg" backupdir="backups" steamclient="${rootdir}/steamcmd/linux32/steamclient.so" # Server Details -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') +rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') # Logging logdays="7" @@ -355,6 +357,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -516,8 +525,8 @@ echo -en "\n" fn_details(){ fn_autoip -servername=$(grep -s hostname "${servercfg}"|sed 's/hostname //g'|sed 's/"//g') -rcon=$(grep -s rcon_password "${servercfg}"|sed 's/rcon_password //g'|sed 's/"//g') +servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //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) echo "" echo "${gamename} Server Details" @@ -525,7 +534,7 @@ echo "============================" echo "Server name: ${servername}" echo "Server IP: ${ip}:${port}" echo "RCON password: ${rcon}" -echo "Config file: ${servercfg}" +echo "Config file: ${servercfgfullpath}" echo "" echo "${servername} Ports" echo "============================" @@ -729,7 +738,7 @@ echo "=================================" echo "exec ${servicename}.cfg" > "${defaultcfg}" sleep 1 echo "Creating ${servicename}.cfg config file." - touch "${servercfg}" + touch "${servercfgfullpath}" touch "${systemdir}/listip.cfg" touch "${systemdir}/banned.cfg" { @@ -770,7 +779,7 @@ echo "=================================" echo -e "sv_logecho 1" echo -e "sv_logfile 1" echo -e "sv_log_onefile 0" - }|tee "${servercfg}" > /dev/null 2>&1 + }|tee "${servercfgfullpath}" > /dev/null 2>&1 sleep 1 echo "" fn_header diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server index c47787d56..8921d5e52 100644 --- a/UnrealTournament2004/ut2k4server +++ b/UnrealTournament2004/ut2k4server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -344,6 +344,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -552,7 +559,7 @@ echo "WebAdmin Username: ${webadminuser}" echo "WebAdmin Password: ${webadminpass}" echo "" 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 echo -e "Status:\e[0;32m ONLINE\e[0;39m" fi @@ -717,7 +724,7 @@ echo "" fn_utloginstall(){ echo "Creating log directorys" echo "=================================" -sleep 1 +sleep 1 mkdir -pv "${rootdir}/log" mkdir -pv "${scriptlogdir}" touch "${scriptlog}" diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server index e10b92637..45f1b17db 100644 --- a/UnrealTournament99/ut99server +++ b/UnrealTournament99/ut99server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://danielgibbs.co.uk -# Version: 240114 +# Version: 010214 #### Variables #### @@ -338,6 +338,13 @@ if [ -f gsquery.py ]; then fn_scriptlog "Querying port: ${ip}:${port}: ${serverquery}" sleep 1 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 subject="${servicename} Monitor - Starting ${servername}" failurereason="Failed to query ${servicename}: ${serverquery}" @@ -541,7 +548,7 @@ echo "WebAdmin Username: ${webadminuser}" echo "WebAdmin Password: ${webadminpass}" echo "" 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 echo -e "Status:\e[0;32m ONLINE\e[0;39m" fi @@ -687,7 +694,7 @@ echo "" fn_utloginstall(){ echo "Creating log directorys" echo "=================================" -sleep 1 +sleep 1 mkdir -pv "${rootdir}/log" mkdir -pv "${scriptlogdir}" touch "${scriptlog}"