Browse Source

Migrated to new split functions system

All scripts now have the new split functions system in-place.

Some functions now have there own file rather than being in the main
script file.
If the main script requires the file is will automatically download it
in the the functions dir for use.

Only a few functions currently do this. However if a change is made to a
function it will be migrated. In the long term this will reduce the need
for me to copy the same code over 20 times and drastically reduce the
time it takes me to make changes.
pull/254/merge
Daniel Gibbs 11 years ago
parent
commit
c5f321dff4
  1. 256
      Arma3/arma3server
  2. 222
      BladeSymphony/bsserver
  3. 115
      CounterStrike/csserver
  4. 110
      CounterStrikeConditionZero/csczserver
  5. 175
      CounterStrikeGlobalOffensive/csgoserver
  6. 12
      CounterStrikeSource/cssserver
  7. 108
      DayOfDefeat/dodserver
  8. 122
      DayOfDefeatSource/dodsserver
  9. 222
      FistfulOfFrags/fofserver
  10. 4
      GarrysMod/gmodserver
  11. 114
      HalfLife2Deathmatch/hl2dmserver
  12. 110
      HalfLifeDeathmatchClassic/hldmcserver
  13. 222
      Insurgency/insserver
  14. 93
      JustCause2/jc2server
  15. 137
      KillingFloor/kfserver
  16. 114
      Left4Dead/l4dserver
  17. 115
      Left4Dead2/l4d2server
  18. 224
      NaturalSelection2/ns2server
  19. 3
      NoMoreRoomInHell/nmrihserver
  20. 137
      RedOrchestra/roserver
  21. 108
      TeamFortress2/tf2server
  22. 110
      TeamFortressClassic/tfcserver
  23. 124
      UnrealTournament2004/ut2k4server
  24. 122
      UnrealTournament99/ut99server

256
Arma3/arma3server

@ -4,7 +4,7 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Contributor: Scarsz # Contributor: Scarsz
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -196,46 +196,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms}
} }
fn_console(){ fn_console(){
@ -639,35 +604,26 @@ sleep 1
echo -en "\n" echo -en "\n"
} }
fn_arma3details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) functionfile="fn_details"
echo "" fn_fninstall
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${serverport}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "Admin Password: ${adminpass}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "PROTOCOL DESCRIPTION PORT"
echo "UDP Game port ${serverport}"
echo "UDP STEAM query port ${queryport}"
echo "UDP STEAM master traffic port ${masterport}"
echo ""
echo "You can change ports by editing the"
echo "parameters in ${servercfgfullpath}"
echo ""
if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
source functions/fn_details
}
fn_fninstall(){
cd ${rootdir}
if [ ! -d "functions" ]; then
mkdir functions
fi
echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo "" echo ""
} }
@ -676,111 +632,23 @@ echo ""
# #
fn_glibcfix(){ fn_glibcfix(){
if [ -z $(command -v ldd) ]; then if [ ! -f functions/fn_glibcfix ]; then
echo "" functionfile="fn_glibcfix"
echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected." fn_fninstall
sleep 1
echo "Install GLIBC and retry installation"
sleep 1
echo ""
while true; do
read -p "Continue install? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; exit;;
* ) echo "Please answer yes or no.";;
esac
done
elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 215 ]; then
echo "GLIBC Fix required"
echo "============================"
sleep 1
echo -e "\e[0;31mWARNING!\e[0;39m ${gamename} requires GLIBC_2.15 or above"
sleep 1
echo ""
echo "Currently installed: GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')"
echo "Required: => GLIBC_2.15"
echo ""
sleep 1
echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with GLIBC_2.14 or less."
echo "note: This will NOT upgrade GLIBC on your system"
sleep 1
echo ""
echo "Downloading Required files"
echo "================================="
sleep 1
if [ "${gamename}" == "Insurgency" ];then
echo "Detected Insurgency"
sleep 1
echo "Downloading files for Insurgency GLIBC Fix"
cd "${filesdir}/bin"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libc.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/librt.so.1
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libpthread.so.0
sleep 1
elif [ "${gamename}" == "Garrys's Mod" ];then
echo "Detected Garrys's Mod"
sleep 1
echo "Downloading files for Garrys's Mod GLIBC Fix"
sleep 1
cd "${filesdir}/bin"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0
sleep 1
echo ""
elif [ "${gamename}" == "Natural Selection 2" ];then
echo "Detected Natural Selection 2"
sleep 1
echo "Downloading files for Natural Selection 2 GLIBC Fix"
sleep 1
cd "${filesdir}"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NaturalSelection2/dependencies/libm.so.6
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "No More Room in Hell" ];then
echo "Detected No More Room in Hell"
sleep 1
echo "Downloading files for No More Room in Hell GLIBC Fix"
sleep 1
cd "${filesdir}/srcds"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NoMoreRoomInHell/dependencies/libm.so.6
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/srcds/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "Blade Symphony" ];then
echo "Detected Blade Symphony"
sleep 1
echo "Downloading files for Blade Symphony GLIBC Fix"
sleep 1
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "Fistful of Frags" ];then
echo "Detected Fistful of Frags"
sleep 1
echo "Downloading files for Fistful of Frags GLIBC Fix"
sleep 1
cd "${filesdir}"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/FistfulOfFrags/dependencies/libm.so.6
sleep 1
echo ""
elif [ "${gamename}" == "ARMA 3" ];then
echo "Detected ARMA 3"
sleep 1
echo "Downloading files for ARMA 3 GLIBC Fix"
sleep 1
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
else
echo "error: Unable to detect game. Fix not applied"
fi fi
echo "GLIBC fix has been applied!" source functions/fn_glibcfix
sleep 1 }
fn_header(){
clear
echo "================================="
echo "${gamename}"
echo "Linux Game Server Manager"
echo "by Daniel Gibbs"
echo "contributions by Scarsz"
echo "http://danielgibbs.co.uk"
echo "================================="
echo "" echo ""
fi
} }
fn_arma3config(){ fn_arma3config(){
@ -796,18 +664,6 @@ sleep 1
echo "" echo ""
} }
fn_header(){
clear
echo "================================="
echo "${gamename}"
echo "Linux Game Server Manager"
echo "by Daniel Gibbs"
echo "contributions by Scarsz"
echo "http://danielgibbs.co.uk"
echo "================================="
echo ""
}
fn_steamdl(){ fn_steamdl(){
echo "Installing SteamCMD" echo "Installing SteamCMD"
echo "=================================" echo "================================="
@ -850,14 +706,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -878,6 +731,20 @@ sleep 1
echo "" echo ""
} }
fn_getquery(){
echo "GameServerQuery"
echo "============================"
while true; do
read -p "Do you want to install GameServerQuery? [y/N]" yn
case $yn in
[Yy]* ) cd "${rootdir}"; wget -nv -N "http://danielgibbs.co.uk/dl/gsquery.py"; chmod +x gsquery.py; break;;
[Nn]* ) echo -e "Not installing GameServerQuery.";break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
}
fn_retryinstall(){ fn_retryinstall(){
while true; do while true; do
read -p "Retry install? [y/N]" yn read -p "Retry install? [y/N]" yn
@ -921,13 +788,14 @@ fn_steamdl
fn_steaminstall fn_steaminstall
fn_steamfix fn_steamfix
fn_loginstall fn_loginstall
fn_getquery
fn_glibcfix fn_glibcfix
fn_arma3config fn_arma3config
sleep 1 sleep 1
echo "" echo ""
fn_header fn_header
sleep 1 sleep 1
fn_arma3details fn_details
sleep 1 sleep 1
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
@ -961,7 +829,7 @@ case "$1" in
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details) details)
fn_arma3details;; fn_details;;
backup) backup)
fn_backupserver;; fn_backupserver;;
console) console)

222
BladeSymphony/bsserver

@ -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: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -200,46 +200,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -644,38 +609,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -683,111 +636,11 @@ echo ""
# #
fn_glibcfix(){ fn_glibcfix(){
if [ -z $(command -v ldd) ]; then if [ ! -f functions/fn_glibcfix ]; then
echo "" functionfile="fn_glibcfix"
echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected." fn_fninstall
sleep 1
echo "Install GLIBC and retry installation"
sleep 1
echo ""
while true; do
read -p "Continue install? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; exit;;
* ) echo "Please answer yes or no.";;
esac
done
elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 215 ]; then
echo "GLIBC Fix required"
echo "============================"
sleep 1
echo -e "\e[0;31mWARNING!\e[0;39m ${gamename} requires GLIBC_2.15 or above"
sleep 1
echo ""
echo "Currently installed: GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')"
echo "Required: => GLIBC_2.15"
echo ""
sleep 1
echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with GLIBC_2.14 or less."
echo "note: This will NOT upgrade GLIBC on your system"
sleep 1
echo ""
echo "Downloading Required files"
echo "================================="
sleep 1
if [ "${gamename}" == "Insurgency" ];then
echo "Detected Insurgency"
sleep 1
echo "Downloading files for Insurgency GLIBC Fix"
cd "${filesdir}/bin"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libc.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/librt.so.1
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libpthread.so.0
sleep 1
elif [ "${gamename}" == "Garrys's Mod" ];then
echo "Detected Garrys's Mod"
sleep 1
echo "Downloading files for Garrys's Mod GLIBC Fix"
sleep 1
cd "${filesdir}/bin"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0
sleep 1
echo ""
elif [ "${gamename}" == "Natural Selection 2" ];then
echo "Detected Natural Selection 2"
sleep 1
echo "Downloading files for Natural Selection 2 GLIBC Fix"
sleep 1
cd "${filesdir}"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NaturalSelection2/dependencies/libm.so.6
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "No More Room in Hell" ];then
echo "Detected No More Room in Hell"
sleep 1
echo "Downloading files for No More Room in Hell GLIBC Fix"
sleep 1
cd "${filesdir}/srcds"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NoMoreRoomInHell/dependencies/libm.so.6
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/srcds/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "Blade Symphony" ];then
echo "Detected Blade Symphony"
sleep 1
echo "Downloading files for Blade Symphony GLIBC Fix"
sleep 1
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "Fistful of Frags" ];then
echo "Detected Fistful of Frags"
sleep 1
echo "Downloading files for Fistful of Frags GLIBC Fix"
sleep 1
cd "${filesdir}"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/FistfulOfFrags/dependencies/libm.so.6
sleep 1
echo ""
elif [ "${gamename}" == "ARMA 3" ];then
echo "Detected ARMA 3"
sleep 1
echo "Downloading files for ARMA 3 GLIBC Fix"
sleep 1
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
else
echo "error: Unable to detect game. Fix not applied"
fi
echo "GLIBC fix has been applied!"
sleep 1
echo ""
fi fi
source functions/fn_glibcfix
} }
fn_header(){ fn_header(){
@ -843,14 +696,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -943,16 +793,16 @@ echo "================================="
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfgfullpath}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// Server Name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
echo -e "" echo -e ""
echo -e "// rcon passsword" echo -e "// RCON Password"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

115
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: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -75,7 +75,7 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
# what you are doing # what you are doing
fn_scriptlog(){ fn_scriptlog(){
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: '$1'" >> ${scriptlog} echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> ${scriptlog}
} }
# [ FAIL ] # [ FAIL ]
@ -199,46 +199,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -643,38 +608,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -734,14 +687,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -817,9 +767,6 @@ done
fn_header fn_header
fn_steamdl fn_steamdl
fn_steaminstall fn_steaminstall
fn_steaminstall
fn_steaminstall
fn_steaminstall
fn_steamfix fn_steamfix
fn_loginstall fn_loginstall
fn_getquery fn_getquery
@ -866,10 +813,10 @@ echo "================================="
echo -e "// rcon passsword" echo -e "// rcon passsword"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

110
CounterStrikeConditionZero/csczserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -199,46 +199,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -643,38 +608,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -734,14 +687,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -863,10 +813,10 @@ echo "================================="
echo -e "// rcon passsword" echo -e "// rcon passsword"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

175
CounterStrikeGlobalOffensive/csgoserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -217,46 +217,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -662,40 +627,30 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# Game Specific Functions
fn_csgoappidfix(){ fn_csgoappidfix(){
if [ ! -f "${filesdir}/steam_appid.txt" ]; then if [ ! -f "${filesdir}/steam_appid.txt" ]; then
fn_printdots "Applying 730 steam_appid.txt Fix." fn_printdots "Applying 730 steam_appid.txt Fix."
@ -707,6 +662,60 @@ if [ ! -f "${filesdir}/steam_appid.txt" ]; then
fi fi
} }
# Fixes the following error
# Error parsing BotProfile.db - unknown attribute 'Rank"
fn_botprofilefix(){
if ! grep -q "//Rank" "${systemdir}/botprofile.db" ; then
echo "botprofile.db fix removes the following error from appearing on the console:"
echo " Error parsing BotProfile.db - unknown attribute 'Rank"
sleep 1
fn_printdots "Applying botprofile.db fix."
sleep 1
fn_printinfo "Applying botprofile.db fix."
sleep 1
sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db"
echo -en "\n"
echo ""
fi
}
# Fixes errors simular to the following
# Unknown command "cl_bobamt_vert"
fn_valvetcfix(){
if ! grep -q "//exec default" "${servercfgdir}/valve.rc" || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc"; then
echo "valve.rc fix removes the following error from appearing on the console:"
echo " Unknown command \"cl_bobamt_vert\""
sleep 1
fn_printdots "Applying valve.rc fix."
sleep 1
fn_printinfo "Applying valve.rc fix."
sleep 1
sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc"
sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc"
echo -en "\n"
echo ""
fi
}
# Fixes errors simular to the following
# http://forums.steampowered.com/forums/showthread.php?t=3170366
fn_workshopmapfix(){
if [ -f "${systemdir}/subscribed_collection_ids.txt" ]||[ -f "${systemdir}/subscribed_file_ids.txt" ]||[ -f "${systemdir}/ugc_collection_cache.txt" ]; then
echo "workshopmapfix fixes the following error:"
echo " http://forums.steampowered.com/forums/showthread.php?t=3170366"
sleep 1
fn_printdots "Applying workshopmap fix."
sleep 1
fn_printinfo "Applying workshopmap fix."
sleep 1
rm -f "${systemdir}/subscribed_collection_ids.txt"
rm -f "${systemdir}/subscribed_file_ids.txt"
rm -f "${systemdir}/ugc_collection_cache.txt"
echo -en "\n"
echo ""
fi
}
# #
## Installer ## Installer
# #
@ -764,14 +773,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -863,16 +869,16 @@ echo "================================="
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfgfullpath}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// Server Name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
echo -e "" echo -e ""
echo -e "// rcon passsword" echo -e "// RCON Password"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"
@ -881,6 +887,11 @@ echo "================================="
}|tee "${servercfgfullpath}" > /dev/null 2>&1 }|tee "${servercfgfullpath}" > /dev/null 2>&1
sleep 1 sleep 1
echo "" echo ""
echo "Applying ${gamename} Fixes"
echo "================================="
fn_botprofilefix
fn_valvetcfix
fn_workshopmapfix
fn_header fn_header
sleep 1 sleep 1
fn_details fn_details

12
CounterStrikeSource/cssserver

@ -622,8 +622,7 @@ if [ ! -d "functions" ]; then
mkdir functions mkdir functions
fi fi
echo "" echo ""
echo "Downloading ${functionfile}" echo "loading ${functionfile}..."
echo "================================="
cd functions cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile} chmod +x ${functionfile}
@ -636,14 +635,6 @@ echo ""
## Installer ## Installer
# #
fn_glibcfix(){
if [ ! -f functions/fn_glibcfix ]; then
functionfile="fn_glibcfix"
fn_fninstall
fi
source functions/fn_glibcfix
}
fn_header(){ fn_header(){
clear clear
echo "=================================" echo "================================="
@ -780,7 +771,6 @@ fn_steaminstall
fn_steamfix fn_steamfix
fn_loginstall fn_loginstall
fn_getquery fn_getquery
fn_glibcfix
echo "Configuring ${gamename} Server" echo "Configuring ${gamename} Server"
echo "=================================" echo "================================="
sleep 1 sleep 1

108
DayOfDefeat/dodserver

@ -199,46 +199,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -643,38 +608,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -734,14 +687,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -866,10 +816,10 @@ echo "================================="
echo -e "// rcon passsword" echo -e "// rcon passsword"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

122
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: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -200,46 +200,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -644,44 +609,40 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
## Installer ## Installer
# #
fn_glibcfix(){
if [ ! -f functions/fn_glibcfix ]; then
functionfile="fn_glibcfix"
fn_fninstall
fi
source functions/fn_glibcfix
}
fn_header(){ fn_header(){
clear clear
echo "=================================" echo "================================="
@ -735,14 +696,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -834,16 +792,16 @@ echo "================================="
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfgfullpath}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// Server Name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
echo -e "" echo -e ""
echo -e "// rcon passsword" echo -e "// RCON Password"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

222
FistfulOfFrags/fofserver

@ -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: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -200,46 +200,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -644,38 +609,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -683,111 +636,11 @@ echo ""
# #
fn_glibcfix(){ fn_glibcfix(){
if [ -z $(command -v ldd) ]; then if [ ! -f functions/fn_glibcfix ]; then
echo "" functionfile="fn_glibcfix"
echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected." fn_fninstall
sleep 1
echo "Install GLIBC and retry installation"
sleep 1
echo ""
while true; do
read -p "Continue install? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; exit;;
* ) echo "Please answer yes or no.";;
esac
done
elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 215 ]; then
echo "GLIBC Fix required"
echo "============================"
sleep 1
echo -e "\e[0;31mWARNING!\e[0;39m ${gamename} requires GLIBC_2.15 or above"
sleep 1
echo ""
echo "Currently installed: GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')"
echo "Required: => GLIBC_2.15"
echo ""
sleep 1
echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with GLIBC_2.14 or less."
echo "note: This will NOT upgrade GLIBC on your system"
sleep 1
echo ""
echo "Downloading Required files"
echo "================================="
sleep 1
if [ "${gamename}" == "Insurgency" ];then
echo "Detected Insurgency"
sleep 1
echo "Downloading files for Insurgency GLIBC Fix"
cd "${filesdir}/bin"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libc.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/librt.so.1
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libpthread.so.0
sleep 1
elif [ "${gamename}" == "Garrys's Mod" ];then
echo "Detected Garrys's Mod"
sleep 1
echo "Downloading files for Garrys's Mod GLIBC Fix"
sleep 1
cd "${filesdir}/bin"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0
sleep 1
echo ""
elif [ "${gamename}" == "Natural Selection 2" ];then
echo "Detected Natural Selection 2"
sleep 1
echo "Downloading files for Natural Selection 2 GLIBC Fix"
sleep 1
cd "${filesdir}"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NaturalSelection2/dependencies/libm.so.6
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "No More Room in Hell" ];then
echo "Detected No More Room in Hell"
sleep 1
echo "Downloading files for No More Room in Hell GLIBC Fix"
sleep 1
cd "${filesdir}/srcds"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NoMoreRoomInHell/dependencies/libm.so.6
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/srcds/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "Blade Symphony" ];then
echo "Detected Blade Symphony"
sleep 1
echo "Downloading files for Blade Symphony GLIBC Fix"
sleep 1
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "Fistful of Frags" ];then
echo "Detected Fistful of Frags"
sleep 1
echo "Downloading files for Fistful of Frags GLIBC Fix"
sleep 1
cd "${filesdir}"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/FistfulOfFrags/dependencies/libm.so.6
sleep 1
echo ""
elif [ "${gamename}" == "ARMA 3" ];then
echo "Detected ARMA 3"
sleep 1
echo "Downloading files for ARMA 3 GLIBC Fix"
sleep 1
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
else
echo "error: Unable to detect game. Fix not applied"
fi
echo "GLIBC fix has been applied!"
sleep 1
echo ""
fi fi
source functions/fn_glibcfix
} }
fn_header(){ fn_header(){
@ -843,14 +696,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -943,16 +793,16 @@ echo "================================="
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfgfullpath}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// Server Name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
echo -e "" echo -e ""
echo -e "// rcon passsword" echo -e "// RCON Password"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

4
GarrysMod/gmodserver

@ -627,8 +627,7 @@ if [ ! -d "functions" ]; then
mkdir functions mkdir functions
fi fi
echo "" echo ""
echo "Downloading ${functionfile}" echo "loading ${functionfile}..."
echo "================================="
cd functions cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile} chmod +x ${functionfile}
@ -815,7 +814,6 @@ echo "================================="
echo -e "sv_logfile 1" echo -e "sv_logfile 1"
echo -e "sv_log_onefile 0" echo -e "sv_log_onefile 0"
echo -e "lua_log_sv 0" echo -e "lua_log_sv 0"
echo -e "sv_rcon_banpenalty 0" echo -e "sv_rcon_banpenalty 0"
echo -e "sv_rcon_maxfailures 20" echo -e "sv_rcon_maxfailures 20"
echo -e "sv_rcon_minfailures 20" echo -e "sv_rcon_minfailures 20"

114
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: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -200,46 +200,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -644,38 +609,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -735,14 +688,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -834,16 +784,16 @@ echo "================================="
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfgfullpath}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// Server Name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
echo -e "" echo -e ""
echo -e "// rcon passsword" echo -e "// RCON Password"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

110
HalfLifeDeathmatchClassic/hldmcserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -199,46 +199,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -643,38 +608,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -734,14 +687,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -866,10 +816,10 @@ echo "================================="
echo -e "// rcon passsword" echo -e "// rcon passsword"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

222
Insurgency/insserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -200,46 +200,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -644,38 +609,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -683,111 +636,11 @@ echo ""
# #
fn_glibcfix(){ fn_glibcfix(){
if [ -z $(command -v ldd) ]; then if [ ! -f functions/fn_glibcfix ]; then
echo "" functionfile="fn_glibcfix"
echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected." fn_fninstall
sleep 1
echo "Install GLIBC and retry installation"
sleep 1
echo ""
while true; do
read -p "Continue install? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; exit;;
* ) echo "Please answer yes or no.";;
esac
done
elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 215 ]; then
echo "GLIBC Fix required"
echo "============================"
sleep 1
echo -e "\e[0;31mWARNING!\e[0;39m ${gamename} requires GLIBC_2.15 or above"
sleep 1
echo ""
echo "Currently installed: GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')"
echo "Required: => GLIBC_2.15"
echo ""
sleep 1
echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with GLIBC_2.14 or less."
echo "note: This will NOT upgrade GLIBC on your system"
sleep 1
echo ""
echo "Downloading Required files"
echo "================================="
sleep 1
if [ "${gamename}" == "Insurgency" ];then
echo "Detected Insurgency"
sleep 1
echo "Downloading files for Insurgency GLIBC Fix"
cd "${filesdir}/bin"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libc.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/librt.so.1
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libpthread.so.0
sleep 1
elif [ "${gamename}" == "Garrys's Mod" ];then
echo "Detected Garrys's Mod"
sleep 1
echo "Downloading files for Garrys's Mod GLIBC Fix"
sleep 1
cd "${filesdir}/bin"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0
sleep 1
echo ""
elif [ "${gamename}" == "Natural Selection 2" ];then
echo "Detected Natural Selection 2"
sleep 1
echo "Downloading files for Natural Selection 2 GLIBC Fix"
sleep 1
cd "${filesdir}"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NaturalSelection2/dependencies/libm.so.6
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "No More Room in Hell" ];then
echo "Detected No More Room in Hell"
sleep 1
echo "Downloading files for No More Room in Hell GLIBC Fix"
sleep 1
cd "${filesdir}/srcds"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NoMoreRoomInHell/dependencies/libm.so.6
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/srcds/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "Blade Symphony" ];then
echo "Detected Blade Symphony"
sleep 1
echo "Downloading files for Blade Symphony GLIBC Fix"
sleep 1
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "Fistful of Frags" ];then
echo "Detected Fistful of Frags"
sleep 1
echo "Downloading files for Fistful of Frags GLIBC Fix"
sleep 1
cd "${filesdir}"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/FistfulOfFrags/dependencies/libm.so.6
sleep 1
echo ""
elif [ "${gamename}" == "ARMA 3" ];then
echo "Detected ARMA 3"
sleep 1
echo "Downloading files for ARMA 3 GLIBC Fix"
sleep 1
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
else
echo "error: Unable to detect game. Fix not applied"
fi
echo "GLIBC fix has been applied!"
sleep 1
echo ""
fi fi
source functions/fn_glibcfix
} }
fn_header(){ fn_header(){
@ -843,14 +696,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -943,16 +793,16 @@ echo "================================="
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfgfullpath}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// Server Name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
echo -e "" echo -e ""
echo -e "// rcon passsword" echo -e "// RCON Password"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

93
JustCause2/jc2server

@ -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: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -194,46 +194,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -637,33 +602,27 @@ sleep 1
echo -en "\n" echo -en "\n"
} }
fn_jc2details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) fn_fninstall
echo "" fi
echo "${gamename} Server Details" source functions/fn_details
echo "============================" }
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" fn_fninstall(){
echo "Config file: ${servercfgfullpath}" cd ${rootdir}
echo "" if [ ! -d "functions" ]; then
echo "${servername} Ports" mkdir functions
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game port ${port}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}."
echo ""
if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -812,7 +771,7 @@ fn_getquery
echo "" echo ""
fn_header fn_header
sleep 1 sleep 1
fn_jc2details fn_details
sleep 1 sleep 1
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"

137
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: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -194,46 +194,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms}
} }
fn_console(){ fn_console(){
@ -637,65 +602,26 @@ sleep 1
echo -en "\n" echo -en "\n"
} }
fn_utdetails(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) functionfile="fn_details"
gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g') fn_fninstall
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|sed 's/\OldQueryPortNumber=//g')
udplinkport=$((${gameport} + 2))
webadminport=$(grep ListenPort= "${systemdir}/${ini}"|sed 's/\ListenPort=//g')
if [ "${engine}" == "unreal" ]; then
webadminuser=$(grep AdminUsername= "${systemdir}/${ini}"|sed 's/\AdminUsername=//g')
else
webadminuser=$(grep AdminName= "${systemdir}/${ini}"|sed 's/\AdminName=//g')
fi
webadminpass=$(grep AdminPassword= "${systemdir}/${ini}"|sed 's/\AdminPassword=//g')
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${gameport}"
echo "Config file: ${systemdir}/${ini}"
echo ""
echo "${servername} Ports"
echo "============================"
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 [ "${engine}" == "unreal" ]; then
echo "OUTBOUND UdpLink Port (random) ${udplinkport}+ UDP n/a"
fi
if [ "${engine}" != "unreal" ] && [ "${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
source functions/fn_details
}
fn_fninstall(){
cd ${rootdir}
if [ ! -d "functions" ]; then
mkdir functions
fi fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo "" echo ""
echo "${servername} WebAdmin" echo "loading ${functionfile}..."
echo "=======================" cd functions
echo "WebAdmin URL: http://${ip}:${webadminport}" wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
echo "WebAdmin Username: ${webadminuser}" chmod +x ${functionfile}
echo "WebAdmin Password: ${webadminpass}" cd ${rootdir}
echo "" sleep 1
if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi
echo "" echo ""
} }
@ -786,14 +712,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -905,7 +828,7 @@ echo "================================="
sleep 5 sleep 5
fn_header fn_header
sleep 1 sleep 1
fn_utdetails fn_details
sleep 1 sleep 1
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
@ -939,7 +862,7 @@ case "$1" in
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details) details)
fn_utdetails;; fn_details;;
backup) backup)
fn_backupserver;; fn_backupserver;;
console) console)

114
Left4Dead/l4dserver

@ -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: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -199,46 +199,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -643,38 +608,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -745,14 +698,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -845,16 +795,16 @@ echo "================================="
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfgfullpath}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// Server Name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
echo -e "" echo -e ""
echo -e "// rcon passsword" echo -e "// RCON Password"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

115
Left4Dead2/l4d2server

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -51,7 +51,6 @@ servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}" servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg" defaultcfg="${servercfgdir}/server.cfg"
backupdir="backups" backupdir="backups"
steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
# Server Details # Server Details
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
@ -200,46 +199,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -644,38 +608,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -735,14 +687,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -834,16 +783,16 @@ echo "================================="
echo "Creating ${servicename}.cfg config file." echo "Creating ${servicename}.cfg config file."
touch "${servercfgfullpath}" touch "${servercfgfullpath}"
{ {
echo -e "// server name" echo -e "// Server Name"
echo -e "hostname \"${servername}\"" echo -e "hostname \"${servername}\""
echo -e "" echo -e ""
echo -e "// rcon passsword" echo -e "// RCON Password"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

224
NaturalSelection2/ns2server

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -199,46 +199,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -642,40 +607,27 @@ sleep 1
echo -en "\n" echo -en "\n"
} }
fn_ns2details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
queryport=$((${port} + 1)) functionfile="fn_details"
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) fn_fninstall
echo "" fi
echo "${gamename} Server Details" source functions/fn_details
echo "============================" }
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" fn_fninstall(){
echo "" cd ${rootdir}
echo "${servername} Ports" if [ ! -d "functions" ]; then
echo "============================" mkdir functions
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
echo "INBOUND Query Port ${queryport}"
echo "INBOUND WebAdmin ${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://${ip}:${webadminport}/index.html"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo ""
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"
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -683,112 +635,11 @@ echo ""
# #
fn_glibcfix(){ fn_glibcfix(){
if [ -z $(command -v ldd) ]; then if [ ! -f functions/fn_glibcfix ]; then
echo "" functionfile="fn_glibcfix"
echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected." fn_fninstall
sleep 1
echo "Install GLIBC and retry installation"
sleep 1
echo ""
while true; do
read -p "Continue install? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; exit;;
* ) echo "Please answer yes or no.";;
esac
done
elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 215 ]; then
echo "GLIBC Fix required"
echo "============================"
sleep 1
echo -e "\e[0;31mWARNING!\e[0;39m ${gamename} requires GLIBC_2.15 or above"
sleep 1
echo ""
echo "Currently installed: GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')"
echo "Required: => GLIBC_2.15"
echo ""
sleep 1
echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with GLIBC_2.14 or less."
echo "note: This will NOT upgrade GLIBC on your system"
sleep 1
echo ""
echo "Downloading Required files"
echo "================================="
sleep 1
if [ "${gamename}" == "Insurgency" ];then
echo "Detected Insurgency"
sleep 1
echo "Downloading files for Insurgency GLIBC Fix"
cd "${filesdir}/bin"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libc.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/librt.so.1
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libpthread.so.0
sleep 1
elif [ "${gamename}" == "Garrys's Mod" ];then
echo "Detected Garrys's Mod"
sleep 1
echo "Downloading files for Garrys's Mod GLIBC Fix"
sleep 1
cd "${filesdir}/bin"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0
sleep 1
echo ""
elif [ "${gamename}" == "Natural Selection 2" ];then
echo "Detected Natural Selection 2"
sleep 1
echo "Downloading files for Natural Selection 2 GLIBC Fix"
sleep 1
cd "${filesdir}"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NaturalSelection2/dependencies/libm.so.6
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NaturalSelection2/dependencies/libc.so.6
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "No More Room in Hell" ];then
echo "Detected No More Room in Hell"
sleep 1
echo "Downloading files for No More Room in Hell GLIBC Fix"
sleep 1
cd "${filesdir}/srcds"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/NoMoreRoomInHell/dependencies/libm.so.6
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/srcds/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "Blade Symphony" ];then
echo "Detected Blade Symphony"
sleep 1
echo "Downloading files for Blade Symphony GLIBC Fix"
sleep 1
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
elif [ "${gamename}" == "Fistful of Frags" ];then
echo "Detected Fistful of Frags"
sleep 1
echo "Downloading files for Fistful of Frags GLIBC Fix"
sleep 1
cd "${filesdir}"
wget -nv -N https://github.com/dgibbs64/linuxgameservers/raw/master/FistfulOfFrags/dependencies/libm.so.6
sleep 1
echo ""
elif [ "${gamename}" == "ARMA 3" ];then
echo "Detected ARMA 3"
sleep 1
echo "Downloading files for ARMA 3 GLIBC Fix"
sleep 1
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
sleep 1
echo ""
else
echo "error: Unable to detect game. Fix not applied"
fi
echo "GLIBC fix has been applied!"
sleep 1
echo ""
fi fi
source functions/fn_glibcfix
} }
fn_header(){ fn_header(){
@ -844,14 +695,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -933,7 +781,7 @@ fn_getquery
fn_glibcfix fn_glibcfix
fn_header fn_header
sleep 1 sleep 1
fn_ns2details fn_details
sleep 1 sleep 1
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
@ -967,7 +815,7 @@ case "$1" in
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details) details)
fn_ns2details;; fn_details;;
backup) backup)
fn_backupserver;; fn_backupserver;;
console) console)

3
NoMoreRoomInHell/nmrihserver

@ -622,8 +622,7 @@ if [ ! -d "functions" ]; then
mkdir functions mkdir functions
fi fi
echo "" echo ""
echo "Downloading ${functionfile}" echo "loading ${functionfile}..."
echo "================================="
cd functions cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile} chmod +x ${functionfile}

137
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: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -190,46 +190,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms}
} }
fn_console(){ fn_console(){
@ -633,65 +598,26 @@ sleep 1
echo -en "\n" echo -en "\n"
} }
fn_utdetails(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) functionfile="fn_details"
gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g') fn_fninstall
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|sed 's/\OldQueryPortNumber=//g')
udplinkport=$((${gameport} + 2))
webadminport=$(grep ListenPort= "${systemdir}/${ini}"|sed 's/\ListenPort=//g')
if [ "${engine}" == "unreal" ]; then
webadminuser=$(grep AdminUsername= "${systemdir}/${ini}"|sed 's/\AdminUsername=//g')
else
webadminuser=$(grep AdminName= "${systemdir}/${ini}"|sed 's/\AdminName=//g')
fi
webadminpass=$(grep AdminPassword= "${systemdir}/${ini}"|sed 's/\AdminPassword=//g')
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${gameport}"
echo "Config file: ${systemdir}/${ini}"
echo ""
echo "${servername} Ports"
echo "============================"
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 [ "${engine}" == "unreal" ]; then
echo "OUTBOUND UdpLink Port (random) ${udplinkport}+ UDP n/a"
fi
if [ "${engine}" != "unreal" ] && [ "${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
source functions/fn_details
}
fn_fninstall(){
cd ${rootdir}
if [ ! -d "functions" ]; then
mkdir functions
fi fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo "" echo ""
echo "${servername} WebAdmin" echo "loading ${functionfile}..."
echo "=======================" cd functions
echo "WebAdmin URL: http://${ip}:${webadminport}" wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
echo "WebAdmin Username: ${webadminuser}" chmod +x ${functionfile}
echo "WebAdmin Password: ${webadminpass}" cd ${rootdir}
echo "" sleep 1
if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi
echo "" echo ""
} }
@ -782,14 +708,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -901,7 +824,7 @@ echo "================================="
sleep 5 sleep 5
fn_header fn_header
sleep 1 sleep 1
fn_utdetails fn_details
sleep 1 sleep 1
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
@ -935,7 +858,7 @@ case "$1" in
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details) details)
fn_utdetails;; fn_details;;
backup) backup)
fn_backupserver;; fn_backupserver;;
console) console)

108
TeamFortress2/tf2server

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -200,46 +200,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -644,38 +609,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -735,14 +688,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -843,7 +793,7 @@ echo "================================="
echo -e "// Server password" echo -e "// Server password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

110
TeamFortressClassic/tfcserver

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -199,46 +199,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms} -debug
} }
fn_console(){ fn_console(){
@ -643,38 +608,26 @@ echo -en "\n"
} }
fn_details(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') functionfile="fn_details"
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') fn_fninstall
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi fi
echo "OUTBOUND Client port ${clientport}" source functions/fn_details
echo "" }
echo "You can change ports by editing the"
echo "start parameters in ${selfname}." fn_fninstall(){
echo "" cd ${rootdir}
if [ "${pid}" == "0" ]; then if [ ! -d "functions" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" mkdir functions
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
echo "loading ${functionfile}..."
cd functions
wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
chmod +x ${functionfile}
cd ${rootdir}
sleep 1
echo ""
} }
# #
@ -734,14 +687,11 @@ echo ""
} }
fn_steamfix(){ fn_steamfix(){
echo "Applying steamclient.so fix" if [ ! -f functions/fn_steamfix ]; then
echo "=================================" functionfile="fn_steamfix"
sleep 1 fn_fninstall
mkdir -pv "${HOME}/.steam" fi
mkdir -pv "${HOME}/.steam/sdk32" source functions/fn_steamfix
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
sleep 1
echo ""
} }
fn_loginstall(){ fn_loginstall(){
@ -866,10 +816,10 @@ echo "================================="
echo -e "// rcon passsword" echo -e "// rcon passsword"
echo -e "rcon_password \"${rconpass}\"" echo -e "rcon_password \"${rconpass}\""
echo -e "" echo -e ""
echo -e "// Server password" echo -e "// Server Password"
echo -e "sv_password \"\"" echo -e "sv_password \"\""
echo -e "" echo -e ""
echo -e "// server logging" echo -e "// Server Logging"
echo -e "log on" echo -e "log on"
echo -e "sv_logbans 1" echo -e "sv_logbans 1"
echo -e "sv_logecho 1" echo -e "sv_logecho 1"

124
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: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -183,46 +183,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms}
} }
fn_console(){ fn_console(){
@ -594,65 +559,26 @@ sleep 1
echo -en "\n" echo -en "\n"
} }
fn_utdetails(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) functionfile="fn_details"
gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g') fn_fninstall
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|sed 's/\OldQueryPortNumber=//g')
udplinkport=$((${gameport} + 2))
webadminport=$(grep ListenPort= "${systemdir}/${ini}"|sed 's/\ListenPort=//g')
if [ "${engine}" == "unreal" ]; then
webadminuser=$(grep AdminUsername= "${systemdir}/${ini}"|sed 's/\AdminUsername=//g')
else
webadminuser=$(grep AdminName= "${systemdir}/${ini}"|sed 's/\AdminName=//g')
fi
webadminpass=$(grep AdminPassword= "${systemdir}/${ini}"|sed 's/\AdminPassword=//g')
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${gameport}"
echo "Config file: ${systemdir}/${ini}"
echo ""
echo "${servername} Ports"
echo "============================"
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 [ "${engine}" == "unreal" ]; then
echo "OUTBOUND UdpLink Port (random) ${udplinkport}+ UDP n/a"
fi
if [ "${engine}" != "unreal" ] && [ "${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
source functions/fn_details
}
fn_fninstall(){
cd ${rootdir}
if [ ! -d "functions" ]; then
mkdir functions
fi fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://${ip}:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo "" echo ""
if [ "${pid}" == "0" ]; then echo "loading ${functionfile}..."
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" cd functions
else wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
echo -e "Status:\e[0;32m ONLINE\e[0;39m" chmod +x ${functionfile}
fi cd ${rootdir}
sleep 1
echo "" echo ""
} }
@ -919,7 +845,7 @@ echo "================================="
sleep 5 sleep 5
fn_header fn_header
sleep 1 sleep 1
fn_utdetails fn_details
sleep 1 sleep 1
echo "=================================" echo "================================="
echo "Install Complete!" echo "Install Complete!"
@ -941,7 +867,7 @@ case "$1" in
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details) details)
fn_utdetails;; fn_details;;
backup) backup)
fn_backupserver;; fn_backupserver;;
console) console)

122
UnrealTournament99/ut99server

@ -3,7 +3,7 @@
# Server Management Script # Server Management Script
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 061014 # Version: 121114
#### Variables #### #### Variables ####
@ -180,46 +180,11 @@ fi
} }
fn_debugserver(){ fn_debugserver(){
fn_rootcheck if [ ! -f functions/fn_debugserver ]; then
fn_syscheck functionfile="fn_debugserver"
fn_autoip fn_fninstall
fn_distro fi
fn_uptime source functions/fn_debugserver
fn_load
fn_parms
echo ""
echo "${gamename} Debug"
echo "============================"
echo ""
echo -e "Distro: ${os}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo ""
echo "Start parameters:"
echo ${parms}
echo ""
echo -e "Use for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode"
echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
echo ""
while true; do
read -p "Continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo Exiting; return 1;;
* ) echo "Please answer yes or no.";;
esac
done
fn_stopserver
fn_printdots "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_printok "Starting debug mode ${servicename}: ${servername}"
sleep 1
fn_scriptlog "Started debug mode ${servername}"
echo -en "\n"
cd "${executabledir}"
${executable} ${parms}
} }
fn_console(){ fn_console(){
@ -591,65 +556,26 @@ sleep 1
echo -en "\n" echo -en "\n"
} }
fn_utdetails(){ fn_details(){
fn_autoip if [ ! -f functions/fn_details ]; then
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) functionfile="fn_details"
gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g') fn_fninstall
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|sed 's/\OldQueryPortNumber=//g')
udplinkport=$((${gameport} + 2))
webadminport=$(grep ListenPort= "${systemdir}/${ini}"|sed 's/\ListenPort=//g')
if [ "${engine}" == "unreal" ]; then
webadminuser=$(grep AdminUsername= "${systemdir}/${ini}"|sed 's/\AdminUsername=//g')
else
webadminuser=$(grep AdminName= "${systemdir}/${ini}"|sed 's/\AdminName=//g')
fi
webadminpass=$(grep AdminPassword= "${systemdir}/${ini}"|sed 's/\AdminPassword=//g')
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${gameport}"
echo "Config file: ${systemdir}/${ini}"
echo ""
echo "${servername} Ports"
echo "============================"
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 [ "${engine}" == "unreal" ]; then
echo "OUTBOUND UdpLink Port (random) ${udplinkport}+ UDP n/a"
fi
if [ "${engine}" != "unreal" ] && [ "${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
source functions/fn_details
}
fn_fninstall(){
cd ${rootdir}
if [ ! -d "functions" ]; then
mkdir functions
fi fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://${ip}:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo "" echo ""
if [ "${pid}" == "0" ]; then echo "loading ${functionfile}..."
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" cd functions
else wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
echo -e "Status:\e[0;32m ONLINE\e[0;39m" chmod +x ${functionfile}
fi cd ${rootdir}
sleep 1
echo "" echo ""
} }
@ -912,7 +838,7 @@ case "$1" in
email-test) email-test)
fn_emailtest;; fn_emailtest;;
details) details)
fn_utdetails;; fn_details;;
backup) backup)
fn_backupserver;; fn_backupserver;;
console) console)

Loading…
Cancel
Save