Browse Source

Added fn_details & changed server files default location

* Added details function to all game scripts
* Changed filesdir so all server files will be located in 'serverfiles'
directory and not 'csgo'/tf2 etc directory
pull/8/merge
Daniel Gibbs 12 years ago
parent
commit
305995fe72
  1. 116
      CounterStrike/csserver
  2. 113
      CounterStrikeGlobalOffensive/csgoserver
  3. 114
      CounterStrikeSource/cssserver
  4. 115
      DayOfDefeatSource/dodsserver
  5. 115
      HalfLife2Deathmatch/hl2dmserver
  6. 40
      KillingFloor/kfserver
  7. 137
      Left4Dead2/l4d2server
  8. 120
      RedOrchestra/roserver
  9. 116
      TeamFortress2/tf2server
  10. 34
      UnrealTournament2004/ut2k4server

116
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: 010813 # Version: 310813
#### Variables #### #### Variables ####
@ -15,7 +15,8 @@ email="[email protected]"
# Start vars # Start vars
defaultmap="de_aztec" defaultmap="de_aztec"
port="27015" port="27015"
parms="-game cstrike +map ${defaultmap} -strictportbind +port ${port}" clientport="27005"
parms="-game cstrike +map ${defaultmap} -strictportbind -port ${port} +clientport ${clientport}"
#### Advanced Variables #### #### Advanced Variables ####
@ -25,13 +26,15 @@ appid="90"
# Directorys # Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
filesdir="${rootdir}/cs" filesdir="${rootdir}/serverfiles"
servercfg="${filesdir}/cstrike/server.cfg" servercfg="${filesdir}/cstrike/server.cfg"
# Server names # Server names
servicename="cs-server" servicename="cs-server"
gamename="Counter Strike 1.6" gamename="Counter Strike 1.6"
engine="goldsource"
servername=`grep -s hostname ${servercfg} | sed 's/hostname //g'|sed 's/"//g'` 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'`
# Logging # Logging
logdir="${rootdir}/log/script" logdir="${rootdir}/log/script"
@ -77,7 +80,7 @@ if [ -f serverquery.py ];then
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile}
sleep 1 sleep 1
fn_restartserver fn_restartserver
else else
echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}" echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile}
sleep 1 sleep 1
@ -166,7 +169,7 @@ if [ "${emailnotification}" = "on" ];then
failurereason="Testing ${servicename} email notification" failurereason="Testing ${servicename} email notification"
actiontaken="Sent test email...hello is this thing on?" actiontaken="Sent test email...hello is this thing on?"
fn_emailnotification fn_emailnotification
else else
echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled" echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile}
fi fi
@ -276,7 +279,7 @@ else
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile}
echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete" echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile}
fi fi
} }
fn_updateserver(){ fn_updateserver(){
@ -289,8 +292,78 @@ cd steamcmd
./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile} ./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile}
} }
fn_details(){
echo ""
echo "${gamename} Server Details"
echo "============================"
echo ""
echo "${servername} Ports"
echo "======================="
if [ "${engine}" = "unreal2" ];then
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g')
webadminport=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g')
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g')
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g')
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a"
if [ "${appid}" != "223250" ];then
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ];then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi
if [ "${appid}" ];then
if [ "${appid}" == "223250" ];then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://localhost:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo ""
echo "Config file"
echo "${systemdir}/${ini}"
elif [ "${engine}" = "source" ]||[ "${engine}" = "goldsource" ];then
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'`
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/Rcon Port ${port}"
if [ "${engine}" = "source" ];then
echo "INBOUND SourceTV Port ${sourcetvport}"
fi
echo "OUTBOUND Client Port ${clientport}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}"
echo ""
echo "${servername} Details"
echo "======================="
echo "Server name: ${servername}"
echo "Rcon Password: ${rcon}"
echo ""
echo "Config file:"
echo "${servercfg}"
fi
echo ""
}
# #
##Installer ## Installer
# #
fn_header(){ fn_header(){
@ -311,7 +384,7 @@ cd ${rootdir}
mkdir steamcmd mkdir steamcmd
cd steamcmd cd steamcmd
if [ ! -f steam.sh ];then if [ ! -f steam.sh ];then
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --verbose -zxf steamcmd_linux.tar.gz tar --verbose -zxf steamcmd_linux.tar.gz
rm -v steamcmd_linux.tar.gz rm -v steamcmd_linux.tar.gz
chmod +x steam.sh chmod +x steam.sh
@ -352,7 +425,7 @@ echo "Install Directory:"
pwd pwd
echo "" echo ""
while true; do while true; do
read -p "Continue [y/N]" yn read -p "Continue [y/N]" yn
case $yn in case $yn in
[Yy]* ) break;; [Yy]* ) break;;
[Nn]* ) echo Exiting; return 1 ;; [Nn]* ) echo Exiting; return 1 ;;
@ -387,11 +460,11 @@ echo "================================="
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
echo "" fn_header
echo "Configuring ${gamename} Server" echo "Configuring ${gamename} Server"
echo "=================================" echo "================================="
read -p "Enter rcon password: " rconpass
read -p "Enter server name: " servername read -p "Enter server name: " servername
read -p "Enter rcon password: " rconpass
sleep 1 sleep 1
echo "" echo ""
echo "Creating server.cfg" echo "Creating server.cfg"
@ -452,19 +525,8 @@ echo "================================="
mkdir -v ${rootdir}/.steam/sdk32 mkdir -v ${rootdir}/.steam/sdk32
cp -v ${filesdir}/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so cp -v ${filesdir}/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so
sleep 1 sleep 1
echo "" fn_header
echo "${gamename} Server Details" fn_details
echo "================================="
hostname=`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'`
echo "Server hostname: ${hostname}"
echo "Rcon password: ${rcon}"
echo "You can edit these in server.cfg:"
echo "${servercfg}"
echo ""
echo "Server IP: localhost:27015"
echo "You can change port by editing the"
echo "start parms in ${selfname}"
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
echo "" echo ""
@ -492,8 +554,10 @@ case "$1" in
fn_debugserver;; fn_debugserver;;
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details)
fn_details;;
*) *)
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test}" echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test|details}"
exit 1;; exit 1;;
esac esac
exit exit

113
CounterStrikeGlobalOffensive/csgoserver

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
# Counter Strike: Global Offensive # Counter Strike: Global Offensive
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 010813 # Version: 310813
#### Variables #### #### Variables ####
@ -27,13 +27,15 @@ appid="740"
# Directorys # Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
filesdir="${rootdir}/csgo" filesdir="${rootdir}/serverfiles"
servercfg="${filesdir}/csgo/cfg/server.cfg" servercfg="${filesdir}/csgo/cfg/server.cfg"
# Server names # Server names
servicename="csgo-server" servicename="csgo-server"
gamename="Counter Strike: Global Offensive" gamename="Counter Strike: Global Offensive"
engine="source"
servername=`grep -s hostname ${servercfg} | sed 's/hostname //g'|sed 's/"//g'` 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'`
# Logging # Logging
logdir="${rootdir}/log/script" logdir="${rootdir}/log/script"
@ -79,7 +81,7 @@ if [ -f serverquery.py ];then
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile}
sleep 1 sleep 1
fn_restartserver fn_restartserver
else else
echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}" echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile}
sleep 1 sleep 1
@ -168,7 +170,7 @@ if [ "${emailnotification}" = "on" ];then
failurereason="Testing ${servicename} email notification" failurereason="Testing ${servicename} email notification"
actiontaken="Sent test email...hello is this thing on?" actiontaken="Sent test email...hello is this thing on?"
fn_emailnotification fn_emailnotification
else else
echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled" echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile}
fi fi
@ -278,7 +280,7 @@ else
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile}
echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete" echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile}
fi fi
} }
fn_updateserver(){ fn_updateserver(){
@ -291,8 +293,78 @@ cd steamcmd
./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile} ./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile}
} }
fn_details(){
echo ""
echo "${gamename} Server Details"
echo "============================"
echo ""
echo "${servername} Ports"
echo "======================="
if [ "${engine}" = "unreal2" ];then
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g')
webadminport=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g')
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g')
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g')
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a"
if [ "${appid}" != "223250" ];then
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ];then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi
if [ "${appid}" ];then
if [ "${appid}" == "223250" ];then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://localhost:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo ""
echo "Config file"
echo "${systemdir}/${ini}"
elif [ "${engine}" = "source" ]||[ "${engine}" = "goldsource" ];then
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'`
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/Rcon Port ${port}"
if [ "${engine}" = "source" ];then
echo "INBOUND SourceTV Port ${sourcetvport}"
fi
echo "OUTBOUND Client Port ${clientport}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}"
echo ""
echo "${servername} Details"
echo "======================="
echo "Server name: ${servername}"
echo "Rcon Password: ${rcon}"
echo ""
echo "Config file:"
echo "${servercfg}"
fi
echo ""
}
# #
##Installer ## Installer
# #
fn_header(){ fn_header(){
@ -313,7 +385,7 @@ cd ${rootdir}
mkdir steamcmd mkdir steamcmd
cd steamcmd cd steamcmd
if [ ! -f steam.sh ];then if [ ! -f steam.sh ];then
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --verbose -zxf steamcmd_linux.tar.gz tar --verbose -zxf steamcmd_linux.tar.gz
rm -v steamcmd_linux.tar.gz rm -v steamcmd_linux.tar.gz
chmod +x steam.sh chmod +x steam.sh
@ -354,7 +426,7 @@ echo "Install Directory:"
pwd pwd
echo "" echo ""
while true; do while true; do
read -p "Continue [y/N]" yn read -p "Continue [y/N]" yn
case $yn in case $yn in
[Yy]* ) break;; [Yy]* ) break;;
[Nn]* ) echo Exiting; return 1 ;; [Nn]* ) echo Exiting; return 1 ;;
@ -388,11 +460,11 @@ echo "================================="
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
echo "" fn_header
echo "Configuring ${gamename} Server" echo "Configuring ${gamename} Server"
echo "=================================" echo "================================="
read -p "Enter rcon password: " rconpass
read -p "Enter server name: " servername read -p "Enter server name: " servername
read -p "Enter rcon password: " rconpass
sleep 1 sleep 1
echo "" echo ""
echo "Creating server.cfg" echo "Creating server.cfg"
@ -429,19 +501,8 @@ echo "================================="
mkdir -v ${rootdir}/.steam/sdk32 mkdir -v ${rootdir}/.steam/sdk32
cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so
sleep 1 sleep 1
echo "" fn_header
echo "${gamename} Server Details" fn_details
echo "================================="
hostname=`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'`
echo "Server hostname: ${hostname}"
echo "Rcon password: ${rcon}"
echo "You can edit these in server.cfg:"
echo "${servercfg}"
echo ""
echo "Server IP: localhost:27015"
echo "You can change port by editing the"
echo "start parms in ${selfname}"
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
echo "" echo ""
@ -469,8 +530,10 @@ case "$1" in
fn_debugserver;; fn_debugserver;;
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details)
fn_details;;
*) *)
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test}" echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test|details}"
exit 1;; exit 1;;
esac esac
exit exit

114
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: 010813 # Version: 310813
#### Variables #### #### Variables ####
@ -27,13 +27,16 @@ appid="232330"
# Directorys # Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
filesdir="${rootdir}/css" filesdir="${rootdir}/serverfiles"
servercfg="${filesdir}/cstrike/cfg/server.cfg" servercfg="${filesdir}/cstrike/cfg/server.cfg"
# Server names # Server Details
servicename="css-server" servicename="css-server"
gamename="Counter Strike: Source" gamename="Counter Strike: Source"
engine="source"
servername=`grep -s hostname ${servercfg} | sed 's/hostname //g'|sed 's/"//g'` 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'`
# Logging # Logging
logdir="${rootdir}/log/script" logdir="${rootdir}/log/script"
@ -79,7 +82,7 @@ if [ -f serverquery.py ];then
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile}
sleep 1 sleep 1
fn_restartserver fn_restartserver
else else
echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}" echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile}
sleep 1 sleep 1
@ -168,7 +171,7 @@ if [ "${emailnotification}" = "on" ];then
failurereason="Testing ${servicename} email notification" failurereason="Testing ${servicename} email notification"
actiontaken="Sent test email...hello is this thing on?" actiontaken="Sent test email...hello is this thing on?"
fn_emailnotification fn_emailnotification
else else
echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled" echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile}
fi fi
@ -278,7 +281,7 @@ else
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile}
echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete" echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile}
fi fi
} }
fn_updateserver(){ fn_updateserver(){
@ -291,8 +294,78 @@ cd steamcmd
./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile} ./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile}
} }
fn_details(){
echo ""
echo "${gamename} Server Details"
echo "============================"
echo ""
echo "${servername} Ports"
echo "======================="
if [ "${engine}" = "unreal2" ];then
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g')
webadminport=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g')
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g')
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g')
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a"
if [ "${appid}" != "223250" ];then
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ];then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi
if [ "${appid}" ];then
if [ "${appid}" == "223250" ];then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://localhost:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo ""
echo "Config file"
echo "${systemdir}/${ini}"
elif [ "${engine}" = "source" ]||[ "${engine}" = "goldsource" ];then
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'`
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/Rcon Port ${port}"
if [ "${engine}" = "source" ];then
echo "INBOUND SourceTV Port ${sourcetvport}"
fi
echo "OUTBOUND Client Port ${clientport}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}"
echo ""
echo "${servername} Details"
echo "======================="
echo "Server name: ${servername}"
echo "Rcon Password: ${rcon}"
echo ""
echo "Config file:"
echo "${servercfg}"
fi
echo ""
}
# #
##Installer ## Installer
# #
fn_header(){ fn_header(){
@ -313,7 +386,7 @@ cd ${rootdir}
mkdir steamcmd mkdir steamcmd
cd steamcmd cd steamcmd
if [ ! -f steam.sh ];then if [ ! -f steam.sh ];then
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --verbose -zxf steamcmd_linux.tar.gz tar --verbose -zxf steamcmd_linux.tar.gz
rm -v steamcmd_linux.tar.gz rm -v steamcmd_linux.tar.gz
chmod +x steam.sh chmod +x steam.sh
@ -354,7 +427,7 @@ echo "Install Directory:"
pwd pwd
echo "" echo ""
while true; do while true; do
read -p "Continue [y/N]" yn read -p "Continue [y/N]" yn
case $yn in case $yn in
[Yy]* ) break;; [Yy]* ) break;;
[Nn]* ) echo Exiting; return 1 ;; [Nn]* ) echo Exiting; return 1 ;;
@ -388,11 +461,11 @@ echo "================================="
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
echo "" fn_header
echo "Configuring ${gamename} Server" echo "Configuring ${gamename} Server"
echo "=================================" echo "================================="
read -p "Enter rcon password: " rconpass
read -p "Enter server name: " servername read -p "Enter server name: " servername
read -p "Enter rcon password: " rconpass
sleep 1 sleep 1
echo "" echo ""
echo "Creating server.cfg" echo "Creating server.cfg"
@ -429,19 +502,8 @@ echo "================================="
mkdir -v ${rootdir}/.steam/sdk32 mkdir -v ${rootdir}/.steam/sdk32
cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so
sleep 1 sleep 1
echo "" fn_header
echo "${gamename} Server Details" fn_details
echo "================================="
hostname=`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'`
echo "Server hostname: ${hostname}"
echo "Rcon password: ${rcon}"
echo "You can edit these in server.cfg:"
echo "${servercfg}"
echo ""
echo "Server IP: localhost:27015"
echo "You can change port by editing the"
echo "start parms in ${selfname}"
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
echo "" echo ""
@ -469,8 +531,10 @@ case "$1" in
fn_debugserver;; fn_debugserver;;
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details)
fn_details;;
*) *)
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test}" echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test|details}"
exit 1;; exit 1;;
esac esac
exit exit

115
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: 010813 # Version: 310813
#### Variables #### #### Variables ####
@ -27,13 +27,15 @@ appid="232290"
# Directorys # Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
filesdir="${rootdir}/dods" filesdir="${rootdir}/serverfiles"
servercfg="${filesdir}/dod/cfg/server.cfg" servercfg="${filesdir}/dod/cfg/server.cfg"
# Server names # Server Details
servicename="dods-server" servicename="dods-server"
gamename="Day of Defeat: Source" gamename="Day of Defeat: Source"
engine="source"
servername=`grep -s hostname ${servercfg} | sed 's/hostname //g'|sed 's/"//g'` 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'`
# Logging # Logging
logdir="${rootdir}/log/script" logdir="${rootdir}/log/script"
@ -79,7 +81,7 @@ if [ -f serverquery.py ];then
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile}
sleep 1 sleep 1
fn_restartserver fn_restartserver
else else
echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}" echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile}
sleep 1 sleep 1
@ -168,7 +170,7 @@ if [ "${emailnotification}" = "on" ];then
failurereason="Testing ${servicename} email notification" failurereason="Testing ${servicename} email notification"
actiontaken="Sent test email...hello is this thing on?" actiontaken="Sent test email...hello is this thing on?"
fn_emailnotification fn_emailnotification
else else
echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled" echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile}
fi fi
@ -278,7 +280,7 @@ else
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile}
echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete" echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile}
fi fi
} }
fn_updateserver(){ fn_updateserver(){
@ -291,8 +293,78 @@ cd steamcmd
./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile} ./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile}
} }
fn_details(){
echo ""
echo "${gamename} Server Details"
echo "============================"
echo ""
echo "${servername} Ports"
echo "======================="
if [ "${engine}" = "unreal2" ];then
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g')
webadminport=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g')
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g')
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g')
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a"
if [ "${appid}" != "223250" ];then
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ];then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi
if [ "${appid}" ];then
if [ "${appid}" == "223250" ];then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://localhost:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo ""
echo "Config file"
echo "${systemdir}/${ini}"
elif [ "${engine}" = "source" ]||[ "${engine}" = "goldsource" ];then
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'`
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/Rcon Port ${port}"
if [ "${engine}" = "source" ];then
echo "INBOUND SourceTV Port ${sourcetvport}"
fi
echo "OUTBOUND Client Port ${clientport}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}"
echo ""
echo "${servername} Details"
echo "======================="
echo "Server name: ${servername}"
echo "Rcon Password: ${rcon}"
echo ""
echo "Config file:"
echo "${servercfg}"
fi
echo ""
}
# #
##Installer ## Installer
# #
fn_header(){ fn_header(){
@ -313,7 +385,7 @@ cd ${rootdir}
mkdir steamcmd mkdir steamcmd
cd steamcmd cd steamcmd
if [ ! -f steam.sh ];then if [ ! -f steam.sh ];then
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --verbose -zxf steamcmd_linux.tar.gz tar --verbose -zxf steamcmd_linux.tar.gz
rm -v steamcmd_linux.tar.gz rm -v steamcmd_linux.tar.gz
chmod +x steam.sh chmod +x steam.sh
@ -354,7 +426,7 @@ echo "Install Directory:"
pwd pwd
echo "" echo ""
while true; do while true; do
read -p "Continue [y/N]" yn read -p "Continue [y/N]" yn
case $yn in case $yn in
[Yy]* ) break;; [Yy]* ) break;;
[Nn]* ) echo Exiting; return 1 ;; [Nn]* ) echo Exiting; return 1 ;;
@ -388,11 +460,11 @@ echo "================================="
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
echo "" fn_header
echo "Configuring ${gamename} Server" echo "Configuring ${gamename} Server"
echo "=================================" echo "================================="
read -p "Enter rcon password: " rconpass
read -p "Enter server name: " servername read -p "Enter server name: " servername
read -p "Enter rcon password: " rconpass
sleep 1 sleep 1
echo "" echo ""
echo "Creating server.cfg" echo "Creating server.cfg"
@ -429,19 +501,8 @@ echo "================================="
mkdir -v ${rootdir}/.steam/sdk32 mkdir -v ${rootdir}/.steam/sdk32
cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so
sleep 1 sleep 1
echo "" fn_header
echo "${gamename} Server Details" fn_details
echo "================================="
hostname=`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'`
echo "Server hostname: ${hostname}"
echo "Rcon password: ${rcon}"
echo "You can edit these in server.cfg:"
echo "${servercfg}"
echo ""
echo "Server IP: localhost:27015"
echo "You can change port by editing the"
echo "start parms in ${selfname}"
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
echo "" echo ""
@ -469,8 +530,10 @@ case "$1" in
fn_debugserver;; fn_debugserver;;
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details)
fn_details;;
*) *)
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test}" echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test|details}"
exit 1;; exit 1;;
esac esac
exit exit

115
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: 010813 # Version: 310813
#### Variables #### #### Variables ####
@ -27,13 +27,17 @@ appid="232370"
# Directorys # Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
filesdir="${rootdir}/hl2dm" filesdir="${rootdir}/serverfiles"
servercfg="${filesdir}/hl2mp/cfg/server.cfg" servercfg="${filesdir}/hl2mp/cfg/server.cfg"
# Server names
# Server Details
servicename="hl2dm-server" servicename="hl2dm-server"
gamename="Half Life 2: Deathmatch" gamename="Half Life 2: Deathmatch"
engine="source"
servername=`grep -s hostname ${servercfg} | sed 's/hostname //g'|sed 's/"//g'` 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'`
# Logging # Logging
logdir="${rootdir}/log/script" logdir="${rootdir}/log/script"
@ -79,7 +83,7 @@ if [ -f serverquery.py ];then
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile}
sleep 1 sleep 1
fn_restartserver fn_restartserver
else else
echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}" echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile}
sleep 1 sleep 1
@ -168,7 +172,7 @@ if [ "${emailnotification}" = "on" ];then
failurereason="Testing ${servicename} email notification" failurereason="Testing ${servicename} email notification"
actiontaken="Sent test email...hello is this thing on?" actiontaken="Sent test email...hello is this thing on?"
fn_emailnotification fn_emailnotification
else else
echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled" echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile}
fi fi
@ -278,7 +282,7 @@ else
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile}
echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete" echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile}
fi fi
} }
fn_updateserver(){ fn_updateserver(){
@ -291,8 +295,78 @@ cd steamcmd
./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile} ./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile}
} }
fn_details(){
echo ""
echo "${gamename} Server Details"
echo "============================"
echo ""
echo "${servername} Ports"
echo "======================="
if [ "${engine}" = "unreal2" ];then
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g')
webadminport=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g')
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g')
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g')
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a"
if [ "${appid}" != "223250" ];then
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ];then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi
if [ "${appid}" ];then
if [ "${appid}" == "223250" ];then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://localhost:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo ""
echo "Config file"
echo "${systemdir}/${ini}"
elif [ "${engine}" = "source" ]||[ "${engine}" = "goldsource" ];then
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'`
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/Rcon Port ${port}"
if [ "${engine}" = "source" ];then
echo "INBOUND SourceTV Port ${sourcetvport}"
fi
echo "OUTBOUND Client Port ${clientport}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}"
echo ""
echo "${servername} Details"
echo "======================="
echo "Server name: ${servername}"
echo "Rcon Password: ${rcon}"
echo ""
echo "Config file:"
echo "${servercfg}"
fi
echo ""
}
# #
##Installer ## Installer
# #
fn_header(){ fn_header(){
@ -313,7 +387,7 @@ cd ${rootdir}
mkdir steamcmd mkdir steamcmd
cd steamcmd cd steamcmd
if [ ! -f steam.sh ];then if [ ! -f steam.sh ];then
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --verbose -zxf steamcmd_linux.tar.gz tar --verbose -zxf steamcmd_linux.tar.gz
rm -v steamcmd_linux.tar.gz rm -v steamcmd_linux.tar.gz
chmod +x steam.sh chmod +x steam.sh
@ -354,7 +428,7 @@ echo "Install Directory:"
pwd pwd
echo "" echo ""
while true; do while true; do
read -p "Continue [y/N]" yn read -p "Continue [y/N]" yn
case $yn in case $yn in
[Yy]* ) break;; [Yy]* ) break;;
[Nn]* ) echo Exiting; return 1 ;; [Nn]* ) echo Exiting; return 1 ;;
@ -388,11 +462,11 @@ echo "================================="
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
echo "" fn_header
echo "Configuring ${gamename} Server" echo "Configuring ${gamename} Server"
echo "=================================" echo "================================="
read -p "Enter rcon password: " rconpass
read -p "Enter server name: " servername read -p "Enter server name: " servername
read -p "Enter rcon password: " rconpass
sleep 1 sleep 1
echo "" echo ""
echo "Creating server.cfg" echo "Creating server.cfg"
@ -429,19 +503,8 @@ echo "================================="
mkdir -v ${rootdir}/.steam/sdk32 mkdir -v ${rootdir}/.steam/sdk32
cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so
sleep 1 sleep 1
echo "" fn_header
echo "${gamename} Server Details" fn_details
echo "================================="
hostname=`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'`
echo "Server hostname: ${hostname}"
echo "Rcon password: ${rcon}"
echo "You can edit these in server.cfg:"
echo "${servercfg}"
echo ""
echo "Server IP: localhost:27015"
echo "You can change port by editing the"
echo "start parms in ${selfname}"
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
echo "" echo ""
@ -469,8 +532,10 @@ case "$1" in
fn_debugserver;; fn_debugserver;;
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details)
fn_details;;
*) *)
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test}" echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test|details}"
exit 1;; exit 1;;
esac esac
exit exit

40
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: 300813 # Version: 310813
#### Variables #### #### Variables ####
@ -22,7 +22,7 @@ appid="215360"
# Directorys # Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
filesdir="${rootdir}/killingfloor" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/System" systemdir="${filesdir}/System"
compressedmapsdir="${rootdir}/Maps-Compressed" compressedmapsdir="${rootdir}/Maps-Compressed"
@ -41,7 +41,7 @@ logdays="7"
# Start vars # Start vars
defaultmap="KF-BioticsLab.rom" defaultmap="KF-BioticsLab.rom"
parms="server ${defaultmap}?game=KFmod.KFGameType -nohomedir ini=${ini} log=${logfile}" parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini=${ini} log=${logfile}"
##### Script ##### ##### Script #####
# Do not edit # Do not edit
@ -373,7 +373,7 @@ if [ "${engine}" = "unreal2" ];then
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g') gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
queryport=$((${gameport} + 1)) queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g') gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g')
webadmin=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g') webadminport=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g')
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g') webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g')
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g') webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g')
echo "Ports the server is currently using" echo "Ports the server is currently using"
@ -381,34 +381,41 @@ if [ "${engine}" = "unreal2" ];then
echo "DIRECTION DESCRIPTION PORT INI VARIABLE" echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}" echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a" echo "INBOUND Query Port ${queryport} UDP n/a"
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}" if [ "${appid}" != "223250" ];then
if [ "${gamename}" == "Killing Floor" ];then echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ];then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a" echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
elif [ "${gamename}" == "Unreal Tournament 2004" ];then else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a" echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi fi
if [ "${appid}" ];then if [ "${appid}" ];then
echo "OUTBOUND Steam Port 20660 UDP n/a" if [ "${appid}" == "223250" ];then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi fi
echo "INBOUND WebAdmin ${webadmin} TCP ListenPort=${webadmin}" echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo "" echo ""
echo "${servername} WebAdmin" echo "${servername} WebAdmin"
echo "=======================" echo "======================="
echo "WebAdmin URL: http://localhost:${webadmin}" echo "WebAdmin URL: http://localhost:${webadminport}"
echo "WebAdmin Username: ${webadminuser}" echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}" echo "WebAdmin Password: ${webadminpass}"
echo "" echo ""
echo "Config file" echo "Config file"
echo "${systemdir}/${ini}" echo "${systemdir}/${ini}"
elif [ "${engine}" = "source" ];then elif [ "${engine}" = "source" ]||[ "${engine}" = "goldsource" ];then
servername=`grep -s hostname ${servercfg} | sed 's/hostname //g'|sed 's/"//g'` 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'` rcon=`grep -s rcon_password ${servercfg} | sed 's/rcon_password //g'|sed 's/"//g'`
echo "Ports the server is currently using" echo "Ports the server is currently using"
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/Rcon Port ${port}" echo "INBOUND Game/Rcon Port ${port}"
echo "INBOUND SourceTV Port ${sourcetvport}" if [ "${engine}" = "source" ];then
echo "INBOUND SourceTV Port ${sourcetvport}"
fi
echo "OUTBOUND Client Port ${clientport}" echo "OUTBOUND Client Port ${clientport}"
echo "" echo ""
echo "You can change ports by editing the" echo "You can change ports by editing the"
@ -426,7 +433,7 @@ echo ""
} }
# #
##Installer ## Installer
# #
fn_header(){ fn_header(){
@ -523,6 +530,7 @@ echo "================================="
fn_header fn_header
echo "Configuring ${gamename} Server" echo "Configuring ${gamename} Server"
echo "=================================" echo "================================="
sleep 1
echo "Copying ${systemdir}/default.ini to ${systemdir}/${ini}" echo "Copying ${systemdir}/default.ini to ${systemdir}/${ini}"
cp ${systemdir}/Default.ini ${systemdir}/${ini} cp ${systemdir}/Default.ini ${systemdir}/${ini}
sleep 1 sleep 1
@ -536,7 +544,7 @@ echo "================================="
sleep 1 sleep 1
echo "Applying WebAdmin CharSet fix!" echo "Applying WebAdmin CharSet fix!"
echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1"
sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' ${systemdir}/UWeb.int sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' ${systemdir}/UWeb.int
sleep 1 sleep 1
echo "Setting WebAdmin username and password" echo "Setting WebAdmin username and password"
sed -i 's/AdminName=/AdminName=admin/g' ${systemdir}/${ini} sed -i 's/AdminName=/AdminName=admin/g' ${systemdir}/${ini}
@ -588,7 +596,7 @@ case "$1" in
fn_steamguard;; fn_steamguard;;
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details) details)
fn_details;; fn_details;;
*) *)
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|map-compressor|steam-auth|email-test|details}" echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|map-compressor|steam-auth|email-test|details}"

137
Left4Dead2/l4d2server

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
# Left 4 Dead 2 # Left 4 Dead 2
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 010813 # Version: 310813
#### Variables #### #### Variables ####
@ -15,7 +15,9 @@ email="[email protected]"
# Start vars # Start vars
defaultmap="c5m1_waterfront" defaultmap="c5m1_waterfront"
port="27015" port="27015"
parms="-strictportbind -game left4dead2 +port ${port} +map ${defaultmap}" sourcetvport="27020"
clientport="27005"
parms="-game left4dead2 +map ${defaultmap} -strictportbind -port ${port} +tv_port ${sourcetvport} +clientport ${clientport}"
#### Advanced Variables #### #### Advanced Variables ####
@ -25,14 +27,15 @@ appid="222860"
# Directorys # Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
filesdir="${rootdir}/l4d2" filesdir="${rootdir}/serverfiles"
servercfg="${filesdir}/left4dead2/cfg/server.cfg" servercfg="${filesdir}/left4dead2/cfg/server.cfg"
# Server names # Server Details
servicename="l4d2-server" servicename="l4d2-server"
gamename="Left 4 Dead 2" gamename="Left 4 Dead 2"
engine="source"
servername=`grep -s hostname ${servercfg} | sed 's/hostname //g'|sed 's/"//g'` 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'`
# Logging # Logging
logdir="${rootdir}/log/script" logdir="${rootdir}/log/script"
@ -42,8 +45,8 @@ logfiledate="${logdir}/${servicename}-$( date '+%d-%m-%Y-%H-%M-%S').log"
logdays="7" logdays="7"
##### Script ##### ##### Script #####
# Do not edit # Do not edit
# unless you know # unless you know
# what you are doing # what you are doing
fn_rootcheck(){ fn_rootcheck(){
@ -78,7 +81,7 @@ if [ -f serverquery.py ];then
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile}
sleep 1 sleep 1
fn_restartserver fn_restartserver
else else
echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}" echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile}
sleep 1 sleep 1
@ -128,7 +131,7 @@ days=$(( uptime/60/60/24 ))
} }
fn_load(){ fn_load(){
load=$(uptime | awk -F 'load average' '{ print $2 }') load=$(uptime | awk -F 'load average' '{ print $2 }')
} }
fn_emailnotification(){ fn_emailnotification(){
@ -138,12 +141,12 @@ fn_load
{ {
echo -e "=========================================\nServer information\n=========================================\n" echo -e "=========================================\nServer information\n=========================================\n"
echo -e "Date: $(date)" echo -e "Date: $(date)"
echo -e "Distro: ${os}" echo -e "Distro: ${os}"
echo -e "Arch: ${arch}" echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}" echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME" echo -e "Hostname: $HOSTNAME"
echo -e "Uptime: ${days}d, ${hours}h, ${minutes}m" echo -e "Uptime: ${days}d, ${hours}h, ${minutes}m"
echo -e "Avg Load${load}\n" echo -e "Avg Load${load}\n"
echo -e "=========================================\n${servicename} statistics\n=========================================\n" echo -e "=========================================\n${servicename} statistics\n=========================================\n"
echo -e "Service: ${servicename}" echo -e "Service: ${servicename}"
echo -e "Server: ${servername}" echo -e "Server: ${servername}"
@ -167,7 +170,7 @@ if [ "${emailnotification}" = "on" ];then
failurereason="Testing ${servicename} email notification" failurereason="Testing ${servicename} email notification"
actiontaken="Sent test email...hello is this thing on?" actiontaken="Sent test email...hello is this thing on?"
fn_emailnotification fn_emailnotification
else else
echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled" echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile}
fi fi
@ -277,7 +280,7 @@ else
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile}
echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete" echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile}
fi fi
} }
fn_updateserver(){ fn_updateserver(){
@ -290,8 +293,78 @@ cd steamcmd
./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile} ./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile}
} }
fn_details(){
echo ""
echo "${gamename} Server Details"
echo "============================"
echo ""
echo "${servername} Ports"
echo "======================="
if [ "${engine}" = "unreal2" ];then
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g')
webadminport=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g')
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g')
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g')
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a"
if [ "${appid}" != "223250" ];then
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ];then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi
if [ "${appid}" ];then
if [ "${appid}" == "223250" ];then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://localhost:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo ""
echo "Config file"
echo "${systemdir}/${ini}"
elif [ "${engine}" = "source" ]||[ "${engine}" = "goldsource" ];then
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'`
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/Rcon Port ${port}"
if [ "${engine}" = "source" ];then
echo "INBOUND SourceTV Port ${sourcetvport}"
fi
echo "OUTBOUND Client Port ${clientport}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}"
echo ""
echo "${servername} Details"
echo "======================="
echo "Server name: ${servername}"
echo "Rcon Password: ${rcon}"
echo ""
echo "Config file:"
echo "${servercfg}"
fi
echo ""
}
# #
##Installer ## Installer
# #
fn_header(){ fn_header(){
@ -312,7 +385,7 @@ cd ${rootdir}
mkdir steamcmd mkdir steamcmd
cd steamcmd cd steamcmd
if [ ! -f steam.sh ];then if [ ! -f steam.sh ];then
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --verbose -zxf steamcmd_linux.tar.gz tar --verbose -zxf steamcmd_linux.tar.gz
rm -v steamcmd_linux.tar.gz rm -v steamcmd_linux.tar.gz
chmod +x steam.sh chmod +x steam.sh
@ -353,7 +426,7 @@ echo "Install Directory:"
pwd pwd
echo "" echo ""
while true; do while true; do
read -p "Continue [y/N]" yn read -p "Continue [y/N]" yn
case $yn in case $yn in
[Yy]* ) break;; [Yy]* ) break;;
[Nn]* ) echo Exiting; return 1 ;; [Nn]* ) echo Exiting; return 1 ;;
@ -387,11 +460,11 @@ echo "================================="
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
echo "" fn_header
echo "Configuring ${gamename} Server" echo "Configuring ${gamename} Server"
echo "=================================" echo "================================="
read -p "Enter rcon password: " rconpass
read -p "Enter server name: " servername read -p "Enter server name: " servername
read -p "Enter rcon password: " rconpass
sleep 1 sleep 1
echo "" echo ""
echo "Creating server.cfg" echo "Creating server.cfg"
@ -413,6 +486,7 @@ echo "================================="
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 ${servercfg} > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
echo "Setting up logging" echo "Setting up logging"
@ -428,25 +502,14 @@ echo "================================="
mkdir -v ${rootdir}/.steam/sdk32 mkdir -v ${rootdir}/.steam/sdk32
cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so
sleep 1 sleep 1
echo "" fn_header
echo "${gamename} Server Details" fn_details
echo "================================="
hostname=`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'`
echo "Server hostname: ${hostname}"
echo "Rcon password: ${rcon}"
echo "You can edit these in server.cfg:"
echo "${servercfg}"
echo ""
echo "Server IP: localhost:27015"
echo "You can change port by editing the"
echo "start parms in ${selfname}"
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
echo "" echo ""
echo "To start server type:" echo "To start server type:"
echo "${selfname} start" echo "${selfname} start"
echo "" echo ""
} }
case "$1" in case "$1" in
@ -468,8 +531,10 @@ case "$1" in
fn_debugserver;; fn_debugserver;;
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details)
fn_details;;
*) *)
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test}" echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test|details}"
exit 1;; exit 1;;
esac esac
exit exit

120
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: 180813 # Version: 310813
#### Variables #### #### Variables ####
@ -15,20 +15,20 @@ email="[email protected]"
# Steam login # Steam login
steamuser="username" steamuser="username"
steampass="password" steampass="password"
# Steam # Steam
appid="223250" appid="223250"
# Directorys # Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
filesdir="${rootdir}/ro" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/system" systemdir="${filesdir}/system"
compressedmapsdir="${rootdir}/Maps-Compressed" compressedmapsdir="${rootdir}/Maps-Compressed"
# Server names # Server names
servicename="ro-server" servicename="ro-server"
gamename="Red Orchestra: Ostfront 41-45" gamename="Red Orchestra: Ostfront 41-45"
engine="unreal2"
ini="${servicename}.ini" ini="${servicename}.ini"
servername=`grep -s ServerName= ${systemdir}/${ini} | sed 's/ServerName=//g'` servername=`grep -s ServerName= ${systemdir}/${ini} | sed 's/ServerName=//g'`
@ -40,7 +40,7 @@ logdays="7"
# Start vars # Start vars
defaultmap="RO-Arad.rom" defaultmap="RO-Arad.rom"
parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true? -nohomedir ini=${ini} log=${logfile}" parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir ini=${ini} log=${logfile}"
##### Script ##### ##### Script #####
# Do not edit # Do not edit
@ -361,8 +361,78 @@ echo "Complete!"
cd ${rootdir} cd ${rootdir}
} }
fn_details(){
echo ""
echo "${gamename} Server Details"
echo "============================"
echo ""
echo "${servername} Ports"
echo "======================="
if [ "${engine}" = "unreal2" ];then
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g')
webadminport=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g')
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g')
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g')
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a"
if [ "${appid}" != "223250" ];then
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ];then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi
if [ "${appid}" ];then
if [ "${appid}" == "223250" ];then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://localhost:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo ""
echo "Config file"
echo "${systemdir}/${ini}"
elif [ "${engine}" = "source" ]||[ "${engine}" = "goldsource" ];then
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'`
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/Rcon Port ${port}"
if [ "${engine}" = "source" ];then
echo "INBOUND SourceTV Port ${sourcetvport}"
fi
echo "OUTBOUND Client Port ${clientport}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}"
echo ""
echo "${servername} Details"
echo "======================="
echo "Server name: ${servername}"
echo "Rcon Password: ${rcon}"
echo ""
echo "Config file:"
echo "${servercfg}"
fi
echo ""
}
# #
##Installer ## Installer
# #
fn_header(){ fn_header(){
@ -456,49 +526,43 @@ echo "================================="
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
echo "" fn_header
echo "Configuring ${gamename} Server" echo "Configuring ${gamename} Server"
echo "=================================" echo "================================="
sleep 1 sleep 1
echo "Copying ${systemdir}/default.ini to ${systemdir}/${ini}" echo "Copying ${systemdir}/default.ini to ${systemdir}/${ini}"
cp ${systemdir}/default.ini ${systemdir}/${ini} cp ${systemdir}/default.ini ${systemdir}/${ini}
sleep 1 sleep 1
echo ""
echo "Creating log directory" echo "Creating log directory"
mkdir -v ${logdir} mkdir -v ${logdir}
sleep 1 sleep 1
echo ""
echo "Applying WebAdmin ROOst.css fix!" echo "Applying WebAdmin ROOst.css fix!"
echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"
sed -i 's/none}/none;/g' ${filesdir}/Web/ServerAdmin/ROOst.css sed -i 's/none}/none;/g' ${filesdir}/Web/ServerAdmin/ROOst.css
sed -i 's/underline}/underline;/g' ${filesdir}/Web/ServerAdmin/ROOst.css sed -i 's/underline}/underline;/g' ${filesdir}/Web/ServerAdmin/ROOst.css
sleep 1 sleep 1
echo "" echo "Applying WebAdmin CharSet fix!"
echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1"
sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' ${systemdir}/uweb.int
sleep 1
echo "Setting WebAdmin username and password" echo "Setting WebAdmin username and password"
sed -i 's/AdminName=/AdminName=admin/g' ${systemdir}/${ini} sed -i 's/AdminName=/AdminName=admin/g' ${systemdir}/${ini}
sed -i 's/AdminPassword=/AdminPassword=ropass/g' ${systemdir}/${ini} sed -i 's/AdminPassword=/AdminPassword=ropass/g' ${systemdir}/${ini}
sleep 1 sleep 1
echo ""
echo "Enabling WebAdmin" echo "Enabling WebAdmin"
sed -i 's/bEnabled=False/bEnabled=True/g' ${systemdir}/${ini} sed -i 's/bEnabled=False/bEnabled=True/g' ${systemdir}/${ini}
sleep 1 sleep 1
echo "" echo "Forcing server to start to get ports/server name to display correctly"
cd ${rootdir}
echo "Default Settings"
echo "=============================="
sleep 1 sleep 1
echo "WebAdmin Details:" cd ${rootdir}
echo "Url: http://localhost:8075" ${selfname} start
echo "Username: admin" sleep 5
echo "Password: ropass" ${selfname} restart
echo "" sleep 5
echo "Port Details:" ${selfname} stop
echo "8075 TCP (WebAdmin Port)" sleep 5
echo "7707 UDP (Game Port)" fn_header
echo "7708 UDP (Query Port)" fn_details
echo "7717 UDP (GameSpy Query Port)"
echo "28852 TCP & UDP (Allows your Server to Connect to the Master Server Browser)"
echo "20560 UDP (Steam Port)"
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
echo "" echo ""
@ -531,8 +595,10 @@ case "$1" in
fn_steamguard;; fn_steamguard;;
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details)
fn_details;;
*) *)
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|map-compressor|steam-auth|email-test}" echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|map-compressor|steam-auth|email-test|details}"
exit 1;; exit 1;;
esac esac
exit exit

116
TeamFortress2/tf2server

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
# Team Fortress 2 # Team Fortress 2
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 010813 # Version: 310813
#### Variables #### #### Variables ####
@ -27,13 +27,16 @@ appid="232250"
# Directorys # Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
filesdir="${rootdir}/tf2" filesdir="${rootdir}/serverfiles"
servercfg="${filesdir}/tf/cfg/server.cfg" servercfg="${filesdir}/tf/cfg/server.cfg"
# Server names # Server Details
servicename="tf2-server" servicename="tf2-server"
engine="source"
gamename="Team Fortress 2" gamename="Team Fortress 2"
engine="source"
servername=`grep -s hostname ${servercfg} | sed 's/hostname //g'|sed 's/"//g'` 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'`
# Logging # Logging
logdir="${rootdir}/log/script" logdir="${rootdir}/log/script"
@ -79,7 +82,7 @@ if [ -f serverquery.py ];then
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} has locked up!" >> ${logfile}
sleep 1 sleep 1
fn_restartserver fn_restartserver
else else
echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}" echo -e "[\e[0;32m OK \e[0;39m] Querying ${servicename}: ${servername}: ${serverquery}"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Querying ${servername}: ${serverquery}" >> ${logfile}
sleep 1 sleep 1
@ -168,7 +171,7 @@ if [ "${emailnotification}" = "on" ];then
failurereason="Testing ${servicename} email notification" failurereason="Testing ${servicename} email notification"
actiontaken="Sent test email...hello is this thing on?" actiontaken="Sent test email...hello is this thing on?"
fn_emailnotification fn_emailnotification
else else
echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled" echo -e "[\e[0;31m FAIL \e[0;39m] Email notificaion not enabled"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Email notificaion not enabled" >> ${logfile}
fi fi
@ -278,7 +281,7 @@ else
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: Monitor detected ${servername} is currently checking for updates!" >> ${logfile}
echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete" echo -e "[\e[0;36m INFO \e[0;39m] ${servicename}: ${servername} will start when updating is complete"
echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile} echo -e "$( date '+%b %d %H:%M:%S') ${servicename}: ${servername} will start when updating is complete" >> ${logfile}
fi fi
} }
fn_updateserver(){ fn_updateserver(){
@ -291,8 +294,78 @@ cd steamcmd
./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile} ./steamcmd.sh +login anonymous +force_install_dir ${filesdir} +app_update ${appid} validate +quit |tee -a ${logfile}
} }
fn_details(){
echo ""
echo "${gamename} Server Details"
echo "============================"
echo ""
echo "${servername} Ports"
echo "======================="
if [ "${engine}" = "unreal2" ];then
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g')
webadminport=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g')
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g')
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g')
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a"
if [ "${appid}" != "223250" ];then
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ];then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi
if [ "${appid}" ];then
if [ "${appid}" == "223250" ];then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://localhost:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo ""
echo "Config file"
echo "${systemdir}/${ini}"
elif [ "${engine}" = "source" ]||[ "${engine}" = "goldsource" ];then
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'`
echo "Ports the server is currently using"
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/Rcon Port ${port}"
if [ "${engine}" = "source" ];then
echo "INBOUND SourceTV Port ${sourcetvport}"
fi
echo "OUTBOUND Client Port ${clientport}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}"
echo ""
echo "${servername} Details"
echo "======================="
echo "Server name: ${servername}"
echo "Rcon Password: ${rcon}"
echo ""
echo "Config file:"
echo "${servercfg}"
fi
echo ""
}
# #
##Installer ## Installer
# #
fn_header(){ fn_header(){
@ -313,7 +386,7 @@ cd ${rootdir}
mkdir steamcmd mkdir steamcmd
cd steamcmd cd steamcmd
if [ ! -f steam.sh ];then if [ ! -f steam.sh ];then
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar --verbose -zxf steamcmd_linux.tar.gz tar --verbose -zxf steamcmd_linux.tar.gz
rm -v steamcmd_linux.tar.gz rm -v steamcmd_linux.tar.gz
chmod +x steam.sh chmod +x steam.sh
@ -354,7 +427,7 @@ echo "Install Directory:"
pwd pwd
echo "" echo ""
while true; do while true; do
read -p "Continue [y/N]" yn read -p "Continue [y/N]" yn
case $yn in case $yn in
[Yy]* ) break;; [Yy]* ) break;;
[Nn]* ) echo Exiting; return 1 ;; [Nn]* ) echo Exiting; return 1 ;;
@ -388,11 +461,11 @@ echo "================================="
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
done done
echo "" fn_header
echo "Configuring ${gamename} Server" echo "Configuring ${gamename} Server"
echo "=================================" echo "================================="
read -p "Enter rcon password: " rconpass
read -p "Enter server name: " servername read -p "Enter server name: " servername
read -p "Enter rcon password: " rconpass
sleep 1 sleep 1
echo "" echo ""
echo "Creating server.cfg" echo "Creating server.cfg"
@ -429,19 +502,8 @@ echo "================================="
mkdir -v ${rootdir}/.steam/sdk32 mkdir -v ${rootdir}/.steam/sdk32
cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so cp -v ${filesdir}/bin/steamclient.so ${rootdir}/.steam/sdk32/steamclient.so
sleep 1 sleep 1
echo "" fn_header
echo "${gamename} Server Details" fn_details
echo "================================="
hostname=`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'`
echo "Server hostname: ${hostname}"
echo "Rcon password: ${rcon}"
echo "You can edit these in server.cfg:"
echo "${servercfg}"
echo ""
echo "Server IP: localhost:27015"
echo "You can change port by editing the"
echo "start parms in ${selfname}"
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
echo "" echo ""
@ -469,8 +531,10 @@ case "$1" in
fn_debugserver;; fn_debugserver;;
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details)
fn_details;;
*) *)
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test}" echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test|details}"
exit 1;; exit 1;;
esac esac
exit exit

34
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: 300813 # Version: 310813
#### Variables #### #### Variables ####
@ -15,7 +15,7 @@ email="[email protected]"
# Directorys # Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0" selfname="$0"
filesdir="${rootdir}/ut2k4" filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/System" systemdir="${filesdir}/System"
compressedmapsdir="${rootdir}/Maps-Compressed" compressedmapsdir="${rootdir}/Maps-Compressed"
@ -288,6 +288,7 @@ echo ""
echo "Compressed maps saved to:" echo "Compressed maps saved to:"
echo "" echo ""
echo "$compressedmapsdir" echo "$compressedmapsdir"
echo "" echo ""
while true; do while true; do
read -p "Start compression [y/N]" yn read -p "Start compression [y/N]" yn
@ -315,7 +316,7 @@ if [ "${engine}" = "unreal2" ];then
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g') gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
queryport=$((${gameport} + 1)) queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g') gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g')
webadmin=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g') webadminport=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g')
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g') webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g')
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g') webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g')
echo "Ports the server is currently using" echo "Ports the server is currently using"
@ -323,34 +324,41 @@ if [ "${engine}" = "unreal2" ];then
echo "DIRECTION DESCRIPTION PORT INI VARIABLE" echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}" echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a" echo "INBOUND Query Port ${queryport} UDP n/a"
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}" if [ "${appid}" != "223250" ];then
if [ "${gamename}" == "Killing Floor" ];then echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ];then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a" echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
elif [ "${gamename}" == "Unreal Tournament 2004" ];then else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a" echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi fi
if [ "${appid}" ];then if [ "${appid}" ];then
echo "OUTBOUND Steam Port 20660 UDP n/a" if [ "${appid}" == "223250" ];then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi fi
echo "INBOUND WebAdmin ${webadmin} TCP ListenPort=${webadmin}" echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo "" echo ""
echo "${servername} WebAdmin" echo "${servername} WebAdmin"
echo "=======================" echo "======================="
echo "WebAdmin URL: http://localhost:${webadmin}" echo "WebAdmin URL: http://localhost:${webadminport}"
echo "WebAdmin Username: ${webadminuser}" echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}" echo "WebAdmin Password: ${webadminpass}"
echo "" echo ""
echo "Config file" echo "Config file"
echo "${systemdir}/${ini}" echo "${systemdir}/${ini}"
elif [ "${engine}" = "source" ];then elif [ "${engine}" = "source" ]||[ "${engine}" = "goldsource" ];then
servername=`grep -s hostname ${servercfg} | sed 's/hostname //g'|sed 's/"//g'` 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'` rcon=`grep -s rcon_password ${servercfg} | sed 's/rcon_password //g'|sed 's/"//g'`
echo "Ports the server is currently using" echo "Ports the server is currently using"
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/Rcon Port ${port}" echo "INBOUND Game/Rcon Port ${port}"
echo "INBOUND SourceTV Port ${sourcetvport}" if [ "${engine}" = "source" ];then
echo "INBOUND SourceTV Port ${sourcetvport}"
fi
echo "OUTBOUND Client Port ${clientport}" echo "OUTBOUND Client Port ${clientport}"
echo "" echo ""
echo "You can change ports by editing the" echo "You can change ports by editing the"
@ -386,6 +394,7 @@ fn_filesdl(){
echo "" echo ""
echo "Downloading Server Files" echo "Downloading Server Files"
echo "============================" echo "============================"
cd ${rootdir} cd ${rootdir}
mkdir ${filesdir} mkdir ${filesdir}
cd ${filesdir} cd ${filesdir}
@ -474,6 +483,7 @@ while true; do
done done
fn_header fn_header
fn_filesdl fn_filesdl
echo "" echo ""
echo "Installing ${gamename} Server" echo "Installing ${gamename} Server"
echo "=================================" echo "================================="

Loading…
Cancel
Save