Ver Fonte

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.
Daniel Gibbs há 11 anos atrás
pai
commit
c5f321dff4

+ 65 - 197
Arma3/arma3server

@@ -4,7 +4,7 @@
 # Author: Daniel Gibbs
 # Contributor: Scarsz
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -196,46 +196,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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}
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -639,35 +604,26 @@ sleep 1
 echo -en "\n"
 }
 
-fn_arma3details(){
-fn_autoip
-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}:${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"
+fn_details(){
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 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 ""
 }
 
@@ -676,111 +632,23 @@ echo ""
 #
 
 fn_glibcfix(){
-if [ -z $(command -v ldd) ]; then
-	echo ""
-	echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected."
-	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
+if [ ! -f functions/fn_glibcfix ]; then
+	functionfile="fn_glibcfix"
+	fn_fninstall
+fi	
+source functions/fn_glibcfix
+}
+
+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_arma3config(){
@@ -796,18 +664,6 @@ sleep 1
 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(){
 echo "Installing SteamCMD"
 echo "================================="
@@ -850,14 +706,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -878,6 +731,20 @@ sleep 1
 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(){
 while true; do
 	read -p "Retry install? [y/N]" yn
@@ -921,13 +788,14 @@ fn_steamdl
 fn_steaminstall
 fn_steamfix
 fn_loginstall
+fn_getquery
 fn_glibcfix
 fn_arma3config
 sleep 1
 echo ""
 fn_header
 sleep 1
-fn_arma3details
+fn_details
 sleep 1
 echo "================================="
 echo "Install Complete!"
@@ -961,7 +829,7 @@ case "$1" in
 	email-test)
 		fn_emailtest;;
 	details)
-		fn_arma3details;;
+		fn_details;;
 	backup)
 		fn_backupserver;;
 	console)
@@ -974,4 +842,4 @@ case "$1" in
 	echo "Usage: $0 {start|stop|restart|update|update-restart|validate|validate-restart|monitor|email-test|details|backup|console|debug|install}"
 	exit 1;;
 esac
-exit
+exit

+ 37 - 187
BladeSymphony/bsserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -200,46 +200,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -644,38 +609,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -683,111 +636,11 @@ echo ""
 #
 
 fn_glibcfix(){
-if [ -z $(command -v ldd) ]; then
-	echo ""
-	echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected."
-	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
+if [ ! -f functions/fn_glibcfix ]; then
+	functionfile="fn_glibcfix"
+	fn_fninstall
+fi	
+source functions/fn_glibcfix
 }
 
 fn_header(){
@@ -843,14 +696,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -943,16 +793,16 @@ echo "================================="
 	echo "Creating ${servicename}.cfg config file."
 	touch "${servercfgfullpath}"
 	{
-		echo -e "// server name"
+		echo -e "// Server Name"
 		echo -e "hostname \"${servername}\""
 		echo -e ""
-		echo -e "// rcon passsword"
+		echo -e "// RCON Password"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 31 - 84
CounterStrike/csserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -75,7 +75,7 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 # what you are doing
 
 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 ]
@@ -199,46 +199,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -643,38 +608,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -734,14 +687,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -817,9 +767,6 @@ done
 fn_header
 fn_steamdl
 fn_steaminstall
-fn_steaminstall
-fn_steaminstall
-fn_steaminstall
 fn_steamfix
 fn_loginstall
 fn_getquery
@@ -866,10 +813,10 @@ echo "================================="
 		echo -e "// rcon passsword"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 30 - 80
CounterStrikeConditionZero/csczserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -199,46 +199,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -643,38 +608,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -734,14 +687,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -863,10 +813,10 @@ echo "================================="
 		echo -e "// rcon passsword"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 128 - 117
CounterStrikeGlobalOffensive/csgoserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -217,46 +217,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -662,40 +627,30 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
+# Game Specific Functions
+
 fn_csgoappidfix(){
 if [ ! -f "${filesdir}/steam_appid.txt" ]; then
 	fn_printdots "Applying 730 steam_appid.txt Fix."
@@ -707,6 +662,60 @@ if [ ! -f "${filesdir}/steam_appid.txt" ]; then
 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
 #
@@ -764,14 +773,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -852,45 +858,50 @@ fn_loginstall
 fn_getquery
 echo "Configuring ${gamename} Server"
 echo "================================="
-	sleep 1
-	read -p "Enter server name: " servername
-	read -p "Enter rcon password: " rconpass
-	sleep 1
-	echo "Creating server.cfg."
-	touch "${defaultcfg}"
-	echo "exec ${servicename}.cfg" > "${defaultcfg}"
-	sleep 1
-	echo "Creating ${servicename}.cfg config file."
-	touch "${servercfgfullpath}"
-	{
-		echo -e "// server name"
-		echo -e "hostname \"${servername}\""
-		echo -e ""
-		echo -e "// rcon passsword"
-		echo -e "rcon_password \"${rconpass}\""
-		echo -e ""
-		echo -e "// Server password"
-		echo -e "sv_password \"\""
-		echo -e ""
-		echo -e "// server logging"
-		echo -e "log on"
-		echo -e "sv_logbans 1"
-		echo -e "sv_logecho 1"
-		echo -e "sv_logfile 1"
-		echo -e "sv_log_onefile 0"
-	}|tee "${servercfgfullpath}" > /dev/null 2>&1
-	sleep 1
-	echo ""
-	fn_header
-	sleep 1
-	fn_details
-	sleep 1
-	echo "================================="
-	echo "Install Complete!"
-	echo ""
-	echo "To start server type:"
-	echo "${selfname} start"
-	echo ""
+sleep 1
+read -p "Enter server name: " servername
+read -p "Enter rcon password: " rconpass
+sleep 1
+echo "Creating server.cfg."
+touch "${defaultcfg}"
+echo "exec ${servicename}.cfg" > "${defaultcfg}"
+sleep 1
+echo "Creating ${servicename}.cfg config file."
+touch "${servercfgfullpath}"
+{
+	echo -e "// Server Name"
+	echo -e "hostname \"${servername}\""
+	echo -e ""
+	echo -e "// RCON Password"
+	echo -e "rcon_password \"${rconpass}\""
+	echo -e ""
+	echo -e "// Server Password"
+	echo -e "sv_password \"\""
+	echo -e ""
+	echo -e "// Server Logging"
+	echo -e "log on"
+	echo -e "sv_logbans 1"
+	echo -e "sv_logecho 1"
+	echo -e "sv_logfile 1"
+	echo -e "sv_log_onefile 0"
+}|tee "${servercfgfullpath}" > /dev/null 2>&1
+sleep 1
+echo ""
+echo "Applying ${gamename} Fixes"
+echo "================================="
+fn_botprofilefix
+fn_valvetcfix
+fn_workshopmapfix
+fn_header
+sleep 1
+fn_details
+sleep 1
+echo "================================="
+echo "Install Complete!"
+echo ""
+echo "To start server type:"
+echo "${selfname} start"
+echo ""
 }
 
 case "$1" in

+ 1 - 11
CounterStrikeSource/cssserver

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

+ 29 - 79
DayOfDefeat/dodserver

@@ -199,46 +199,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -643,38 +608,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -734,14 +687,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -866,10 +816,10 @@ echo "================================="
 		echo -e "// rcon passsword"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 40 - 82
DayOfDefeatSource/dodsserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -200,46 +200,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -644,44 +609,40 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
 ## Installer
 #
 
+fn_glibcfix(){
+if [ ! -f functions/fn_glibcfix ]; then
+	functionfile="fn_glibcfix"
+	fn_fninstall
+fi	
+source functions/fn_glibcfix
+}
+
 fn_header(){
 clear
 echo "================================="
@@ -735,14 +696,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -834,16 +792,16 @@ echo "================================="
 	echo "Creating ${servicename}.cfg config file."
 	touch "${servercfgfullpath}"
 	{
-		echo -e "// server name"
+		echo -e "// Server Name"
 		echo -e "hostname \"${servername}\""
 		echo -e ""
-		echo -e "// rcon passsword"
+		echo -e "// RCON Password"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 37 - 187
FistfulOfFrags/fofserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -200,46 +200,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -644,38 +609,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -683,111 +636,11 @@ echo ""
 #
 
 fn_glibcfix(){
-if [ -z $(command -v ldd) ]; then
-	echo ""
-	echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected."
-	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
+if [ ! -f functions/fn_glibcfix ]; then
+	functionfile="fn_glibcfix"
+	fn_fninstall
+fi	
+source functions/fn_glibcfix
 }
 
 fn_header(){
@@ -843,14 +696,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -943,16 +793,16 @@ echo "================================="
 	echo "Creating ${servicename}.cfg config file."
 	touch "${servercfgfullpath}"
 	{
-		echo -e "// server name"
+		echo -e "// Server Name"
 		echo -e "hostname \"${servername}\""
 		echo -e ""
-		echo -e "// rcon passsword"
+		echo -e "// RCON Password"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 1 - 3
GarrysMod/gmodserver

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

+ 32 - 82
HalfLife2Deathmatch/hl2dmserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -200,46 +200,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -644,38 +609,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -735,14 +688,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -834,16 +784,16 @@ echo "================================="
 	echo "Creating ${servicename}.cfg config file."
 	touch "${servercfgfullpath}"
 	{
-		echo -e "// server name"
+		echo -e "// Server Name"
 		echo -e "hostname \"${servername}\""
 		echo -e ""
-		echo -e "// rcon passsword"
+		echo -e "// RCON Password"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 30 - 80
HalfLifeDeathmatchClassic/hldmcserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -199,46 +199,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -643,38 +608,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -734,14 +687,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -866,10 +816,10 @@ echo "================================="
 		echo -e "// rcon passsword"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 37 - 187
Insurgency/insserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -200,46 +200,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -644,38 +609,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -683,111 +636,11 @@ echo ""
 #
 
 fn_glibcfix(){
-if [ -z $(command -v ldd) ]; then
-	echo ""
-	echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected."
-	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
+if [ ! -f functions/fn_glibcfix ]; then
+	functionfile="fn_glibcfix"
+	fn_fninstall
+fi	
+source functions/fn_glibcfix
 }
 
 fn_header(){
@@ -843,14 +696,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -943,16 +793,16 @@ echo "================================="
 	echo "Creating ${servicename}.cfg config file."
 	touch "${servercfgfullpath}"
 	{
-		echo -e "// server name"
+		echo -e "// Server Name"
 		echo -e "hostname \"${servername}\""
 		echo -e ""
-		echo -e "// rcon passsword"
+		echo -e "// RCON Password"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 26 - 67
JustCause2/jc2server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -194,46 +194,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -637,32 +602,26 @@ sleep 1
 echo -en "\n"
 }
 
-fn_jc2details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-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 "Config file: ${servercfgfullpath}"
-echo ""
-echo "${servername} Ports"
-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"
+fn_details(){
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 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 ""
 }
 
@@ -812,7 +771,7 @@ fn_getquery
 	echo ""
 	fn_header
 	sleep 1
-	fn_jc2details
+	fn_details
 	sleep 1
 	echo "================================="
 	echo "Install Complete!"

+ 30 - 107
KillingFloor/kfserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -194,46 +194,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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}
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -637,65 +602,26 @@ sleep 1
 echo -en "\n"
 }
 
-fn_utdetails(){
-fn_autoip
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
-queryport=$((${gameport} + 1))
-gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|sed 's/\OldQueryPortNumber=//g')
-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"
+fn_details(){
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 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
+source functions/fn_details
+}
+
+fn_fninstall(){
+cd ${rootdir}	
+if [ ! -d "functions" ]; then
+	mkdir functions
 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 ""
-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 "loading ${functionfile}..."
+cd functions
+wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+chmod +x ${functionfile}
+cd ${rootdir}
+sleep 1
 echo ""
 }
 
@@ -786,14 +712,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -905,7 +828,7 @@ echo "================================="
 	sleep 5
 	fn_header
 	sleep 1
-	fn_utdetails
+	fn_details
 	sleep 1
 	echo "================================="
 	echo "Install Complete!"
@@ -939,7 +862,7 @@ case "$1" in
 	email-test)
 		fn_emailtest;;
 	details)
-		fn_utdetails;;
+		fn_details;;
 	backup)
 		fn_backupserver;;
 	console)

+ 32 - 82
Left4Dead/l4dserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -199,46 +199,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -643,38 +608,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -745,14 +698,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -845,16 +795,16 @@ echo "================================="
 	echo "Creating ${servicename}.cfg config file."
 	touch "${servercfgfullpath}"
 	{
-		echo -e "// server name"
+		echo -e "// Server Name"
 		echo -e "hostname \"${servername}\""
 		echo -e ""
-		echo -e "// rcon passsword"
+		echo -e "// RCON Password"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 32 - 83
Left4Dead2/l4d2server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -51,7 +51,6 @@ servercfg="${servicename}.cfg"
 servercfgfullpath="${servercfgdir}/${servercfg}"
 defaultcfg="${servercfgdir}/server.cfg"
 backupdir="backups"
-steamclient="${rootdir}/steamcmd/linux32/steamclient.so"
 
 # Server Details
 servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
@@ -200,46 +199,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -644,38 +608,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -735,14 +687,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -834,16 +783,16 @@ echo "================================="
 	echo "Creating ${servicename}.cfg config file."
 	touch "${servercfgfullpath}"
 	{
-		echo -e "// server name"
+		echo -e "// Server Name"
 		echo -e "hostname \"${servername}\""
 		echo -e ""
-		echo -e "// rcon passsword"
+		echo -e "// RCON Password"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 37 - 189
NaturalSelection2/ns2server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -199,46 +199,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -642,39 +607,26 @@ sleep 1
 echo -en "\n"
 }
 
-fn_ns2details(){
-fn_autoip
-queryport=$((${port} + 1))
-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 ""
-echo "${servername} Ports"
-echo "============================"
-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"
+fn_details(){
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 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 ""
 }
 
@@ -683,112 +635,11 @@ echo ""
 #
 
 fn_glibcfix(){
-if [ -z $(command -v ldd) ]; then
-	echo ""
-	echo -e "\r\033[K\e[0;31mFAIL\e[0;39m GLIBC is not detected."
-	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
+if [ ! -f functions/fn_glibcfix ]; then
+	functionfile="fn_glibcfix"
+	fn_fninstall
+fi	
+source functions/fn_glibcfix
 }
 
 fn_header(){
@@ -844,14 +695,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -933,7 +781,7 @@ fn_getquery
 fn_glibcfix
 	fn_header
 	sleep 1
-	fn_ns2details
+	fn_details
 	sleep 1
 	echo "================================="
 	echo "Install Complete!"
@@ -967,7 +815,7 @@ case "$1" in
 	email-test)
 		fn_emailtest;;
 	details)
-		fn_ns2details;;
+		fn_details;;
 	backup)
 		fn_backupserver;;
 	console)

+ 1 - 2
NoMoreRoomInHell/nmrihserver

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

+ 30 - 107
RedOrchestra/roserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -190,46 +190,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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}
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -633,65 +598,26 @@ sleep 1
 echo -en "\n"
 }
 
-fn_utdetails(){
-fn_autoip
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
-queryport=$((${gameport} + 1))
-gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|sed 's/\OldQueryPortNumber=//g')
-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"
+fn_details(){
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 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
+source functions/fn_details
+}
+
+fn_fninstall(){
+cd ${rootdir}	
+if [ ! -d "functions" ]; then
+	mkdir functions
 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 ""
-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 "loading ${functionfile}..."
+cd functions
+wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+chmod +x ${functionfile}
+cd ${rootdir}
+sleep 1
 echo ""
 }
 
@@ -782,14 +708,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -901,7 +824,7 @@ echo "================================="
 	sleep 5
 	fn_header
 	sleep 1
-	fn_utdetails
+	fn_details
 	sleep 1
 	echo "================================="
 	echo "Install Complete!"
@@ -935,7 +858,7 @@ case "$1" in
 	email-test)
 		fn_emailtest;;
 	details)
-		fn_utdetails;;
+		fn_details;;
 	backup)
 		fn_backupserver;;
 	console)

+ 29 - 79
TeamFortress2/tf2server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -200,46 +200,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -644,38 +609,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -735,14 +688,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -843,7 +793,7 @@ echo "================================="
 		echo -e "// Server password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 30 - 80
TeamFortressClassic/tfcserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -199,46 +199,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -643,38 +608,26 @@ echo -en "\n"
 }
 
 fn_details(){
-fn_autoip
-servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
-rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-echo ""
-echo "${gamename} Server Details"
-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}"
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 fi
-echo "OUTBOUND	Client port		${clientport}"
-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"
+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 ""
 }
 
 #
@@ -734,14 +687,11 @@ echo ""
 }
 
 fn_steamfix(){
-echo "Applying steamclient.so fix"
-echo "================================="
-sleep 1
-mkdir -pv "${HOME}/.steam"
-mkdir -pv "${HOME}/.steam/sdk32"
-cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
-sleep 1
-echo ""
+if [ ! -f functions/fn_steamfix ]; then
+	functionfile="fn_steamfix"
+	fn_fninstall
+fi	
+source functions/fn_steamfix
 }
 
 fn_loginstall(){
@@ -866,10 +816,10 @@ echo "================================="
 		echo -e "// rcon passsword"
 		echo -e "rcon_password \"${rconpass}\""
 		echo -e ""
-		echo -e "// Server password"
+		echo -e "// Server Password"
 		echo -e "sv_password \"\""
 		echo -e ""
-		echo -e "// server logging"
+		echo -e "// Server Logging"
 		echo -e "log on"
 		echo -e "sv_logbans 1"
 		echo -e "sv_logecho 1"

+ 25 - 99
UnrealTournament2004/ut2k4server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -183,46 +183,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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}
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -594,65 +559,26 @@ sleep 1
 echo -en "\n"
 }
 
-fn_utdetails(){
-fn_autoip
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
-queryport=$((${gameport} + 1))
-gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|sed 's/\OldQueryPortNumber=//g')
-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"
+fn_details(){
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 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
+source functions/fn_details
+}
+
+fn_fninstall(){
+cd ${rootdir}	
+if [ ! -d "functions" ]; then
+	mkdir functions
 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 ""
-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 "loading ${functionfile}..."
+cd functions
+wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+chmod +x ${functionfile}
+cd ${rootdir}
+sleep 1
 echo ""
 }
 
@@ -919,7 +845,7 @@ echo "================================="
 	sleep 5
 	fn_header
 	sleep 1
-	fn_utdetails
+	fn_details
 	sleep 1
 	echo "================================="
 	echo "Install Complete!"
@@ -941,7 +867,7 @@ case "$1" in
 	email-test)
 		fn_emailtest;;
 	details)
-		fn_utdetails;;
+		fn_details;;
 	backup)
 		fn_backupserver;;
 	console)

+ 24 - 98
UnrealTournament99/ut99server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 061014
+# Version: 121114
 
 #### Variables ####
 
@@ -180,46 +180,11 @@ fi
 }
 
 fn_debugserver(){
-fn_rootcheck
-fn_syscheck
-fn_autoip
-fn_distro
-fn_uptime
-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}
+if [ ! -f functions/fn_debugserver ]; then
+	functionfile="fn_debugserver"
+	fn_fninstall
+fi
+source functions/fn_debugserver
 }
 
 fn_console(){
@@ -591,65 +556,26 @@ sleep 1
 echo -en "\n"
 }
 
-fn_utdetails(){
-fn_autoip
-pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
-gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g')
-queryport=$((${gameport} + 1))
-gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|sed 's/\OldQueryPortNumber=//g')
-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"
+fn_details(){
+if [ ! -f functions/fn_details ]; then
+	functionfile="fn_details"
+	fn_fninstall
 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
+source functions/fn_details
+}
+
+fn_fninstall(){
+cd ${rootdir}	
+if [ ! -d "functions" ]; then
+	mkdir functions
 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 ""
-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 "loading ${functionfile}..."
+cd functions
+wget -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+chmod +x ${functionfile}
+cd ${rootdir}
+sleep 1
 echo ""
 }
 
@@ -912,7 +838,7 @@ case "$1" in
 	email-test)
 		fn_emailtest;;
 	details)
-		fn_utdetails;;
+		fn_details;;
 	backup)
 		fn_backupserver;;
 	console)