Przeglądaj źródła

Migrated scripts to use fn_functions

* Scripts have been migrated to use fn_functions
* Major changes please report any bug right away
Daniel Gibbs 11 lat temu
rodzic
commit
13b2b2bbe3

+ 1 - 1
7DaysToDie/sdtdserver

@@ -118,7 +118,7 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		norestart=1;;
+		norestart=1;
 		fn_versioncheck;;
 	update-restart)
 		fn_versioncheck;;

+ 1 - 1
Arma3/arma3server

@@ -118,7 +118,7 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		norestart=1;;
+		norestart=1;
 		fn_versioncheck;;
 	update-restart)
 		fn_versioncheck;;

+ 26 - 235
BladeSymphony/bsserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -72,258 +72,50 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_glibcfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_glibcfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_glibcfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -333,11 +125,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 25 - 229
CounterStrike/csserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -71,252 +71,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -326,11 +123,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 25 - 229
CounterStrikeConditionZero/csczserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -71,252 +71,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -326,11 +123,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 235
CounterStrikeGlobalOffensive/csgoserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -89,258 +89,50 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_csgofix
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_csgofix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_csgofix
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -350,11 +142,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
CounterStrikeSource/cssserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -40,7 +40,7 @@ gamename="Counter Strike: Source"
 engine="source"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -72,252 +72,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -327,11 +124,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
DayOfDefeat/dodserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -39,7 +39,7 @@ gamename="Day of Defeat"
 engine="goldsource"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -71,252 +71,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -326,11 +123,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
DayOfDefeatSource/dodsserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -40,7 +40,7 @@ gamename="Day of Defeat: Source"
 engine="source"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -72,252 +72,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -327,11 +124,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 27 - 236
FistfulOfFrags/fofserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -40,7 +40,7 @@ gamename="Fistful of Frags"
 engine="source"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -72,258 +72,50 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_glibcfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_glibcfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_glibcfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -333,11 +125,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 27 - 236
GarrysMod/gmodserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -45,7 +45,7 @@ gamename="Garrys's Mod"
 engine="source"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -77,258 +77,50 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_glibcfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_glibcfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_glibcfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -338,11 +130,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
HalfLife2Deathmatch/hl2dmserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -40,7 +40,7 @@ gamename="Half Life 2: Deathmatch"
 engine="source"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -72,252 +72,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -327,11 +124,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
HalfLifeDeathmatchClassic/hldmcserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -39,7 +39,7 @@ gamename="Half Life: Deathmatch Classic"
 engine="goldsource"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -71,252 +71,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -326,11 +123,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 27 - 236
Insurgency/insserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -40,7 +40,7 @@ gamename="Insurgency"
 engine="source"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -72,258 +72,50 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_glibcfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_glibcfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_glibcfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -333,11 +125,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
JustCause2/jc2server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -36,7 +36,7 @@ gamename="Just Cause 2"
 engine="avalanche"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -66,252 +66,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_glibcfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_glibcfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_glibcfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -321,11 +118,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 39 - 251
KillingFloor/kfserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -16,11 +16,23 @@ email="email@example.com"
 steamuser="username"
 steampass="password"
 
+# Start Variables
+fn_parms(){
+defaultmap="KF-BioticsLab.rom"
+parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini=${ini} log=${gamelog}"
+
+# Start Variables for Objective mode
+#defaultmap="KFO-Steamland"
+#parms="server ${defaultmap}?Game=KFStoryGame.KFStoryGame?VACSecured=true -nohomedir ini=${ini} log=${gamelog}"
+}
+
+#### Advanced Variables ####
+
 # Steam
 appid="215360"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -54,275 +66,52 @@ gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%d-%m-%Y-%H-%M-%S').log"
 scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
 consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
 
-# Start Variables
-fn_parms(){
-defaultmap="KF-BioticsLab.rom"
-parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini=${ini} log=${gamelog}"
-
-# Start Variables for Objective mode
-#defaultmap="KFO-Steamland"
-#parms="server ${defaultmap}?Game=KFStoryGame.KFStoryGame?VACSecured=true -nohomedir ini=${ini} log=${gamelog}"
-}
-
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
-
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
 
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_kffix
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-fn_unreal2compressmaps(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-#
-## Installer
-#
-
-fn_kffix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_kffix
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -332,11 +121,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
Left4Dead/l4dserver

@@ -4,7 +4,7 @@
 # Author: Daniel Gibbs
 # Contributor: Summit Singh Thakur
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -40,7 +40,7 @@ gamename="Left 4 Dead"
 engine="source"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -72,252 +72,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -327,11 +124,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
Left4Dead2/l4d2server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -39,7 +39,7 @@ gamename="Left 4 Dead 2"
 engine="source"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -71,252 +71,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -326,11 +123,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
NaturalSelection2/ns2server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -17,7 +17,7 @@ steamuser="username"
 steampass="password"
 
 # Start Variables
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 defaultmap="ns2_summit"
 port="27015"
 maxplayers="24"
@@ -71,252 +71,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_glibcfix
+fn_loginstall
+fn_getquery
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_glibcfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_glibcfix
-fn_loginstall
-fn_getquery
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -326,11 +123,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 27 - 236
NoMoreRoomInHell/nmrihserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -40,7 +40,7 @@ gamename="No More Room in Hell"
 engine="source"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -72,258 +72,50 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_glibcfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_glibcfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_glibcfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -333,11 +125,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 27 - 241
RedOrchestra/roserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -20,7 +20,7 @@ steampass="password"
 appid="223250"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -62,263 +62,50 @@ parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir in
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_rofix
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-fn_unreal2compressmaps(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-#
-## Installer
-#
-
-fn_rofix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_rofix
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -328,11 +115,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 25 - 234
SeriousSam3BFE/ss3sserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 161214
+# Version: 010115
 
 #### Variables ####
 
@@ -64,257 +64,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_glibcfix
+fn_loginstall
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_glibcfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_glibcfix
-fn_loginstall
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -324,11 +116,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
TeamFortress2/tf2server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -40,7 +40,7 @@ gamename="Team Fortress 2"
 engine="source"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -72,252 +72,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -327,11 +124,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 26 - 230
TeamFortressClassic/tfcserver

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -39,7 +39,7 @@ gamename="Team Fortress Classic"
 engine="goldsource"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -71,252 +71,49 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_steamdl
+fn_steaminstall
+fn_steamfix
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_updateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_validateserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-#
-## Installer
-#
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steaminstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_steamfix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_steamdl
-fn_steaminstall
-fn_steamfix
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
-
-fn_autoinstall(){
-autoinstall=1
-fn_install
-}
+fn_functions
 
 case "$1" in
 	start)
@@ -326,11 +123,10 @@ case "$1" in
 	restart)
 		fn_restartserver;;
 	update)
-		fn_updateserver;;
+		norestart=1;
+		fn_versioncheck;;
 	update-restart)
-		fn_stopserver
-		fn_updateserver
-		fn_startserver;;
+		fn_versioncheck;;
 	validate)
 		fn_validateserver;;
 	validate-restart)

+ 23 - 140
UnrealTournament2004/ut2k4server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -13,7 +13,7 @@ emailnotification="off"
 email="email@example.com"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -55,163 +55,46 @@ parms="server ${defaultmap}?game=XGame.xDeathMatch -nohomedir ini=${ini} log=${g
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_ut2k4filesdl
+fn_ut2k4install
+fn_ut2k4key
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_ut2k4fix
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 

+ 23 - 217
UnrealTournament99/ut99server

@@ -3,7 +3,7 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: http://danielgibbs.co.uk
-# Version: 011214
+# Version: 010115
 
 #### Variables ####
 
@@ -13,7 +13,7 @@ emailnotification="off"
 email="email@example.com"
 
 # Directories
-rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
+rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 selfname="$0"
 lockselfname=$(echo ".${servicename}.lock")
 filesdir="${rootdir}/serverfiles"
@@ -52,243 +52,49 @@ parms="server ${defaultmap}.unr ini=${systemdir}/${ini}"
 
 ##### Script #####
 # Do not edit
-# unless you know
-# what you are doing
 
-fn_scriptlog(){
-	echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-}
-
-# [ FAIL ]
-fn_printfail(){
-    echo -en "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-fn_printfailnl(){
-    echo -e "\r\033[K[\e[0;31m FAIL \e[0;39m] $@"
-}
-
-# [  OK  ]
-fn_printok(){
-    echo -en "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-fn_printoknl(){
-    echo -e "\r\033[K[\e[0;32m  OK  \e[0;39m] $@"
-}
-
-# [ INFO ]
-fn_printinfo(){
-    echo -en "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-fn_printinfonl(){
-    echo -e "\r\033[K[\e[0;36m INFO \e[0;39m] $@"
-}
-
-# [ WARN ]
-fn_printwarn(){
-	echo -en "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-fn_printwarnnl(){
-	echo -e "\r\033[K[\e[1;33m WARN \e[0;39m] $@"
-}
-
-# [ .... ]
-fn_printdots(){
-    echo -en "\r\033[K[ .... ] $@"
-}
-
-fn_rootcheck(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_syscheck(){
-if [ ! -e "${systemdir}" ]; then
-	fn_printfailnl "Cannot access ${systemdir}: No such directory"
-	exit
+fn_install(){
+fn_rootcheck
+fn_header
+if [ -z "${autoinstall}" ]; then
+	fn_serverdirectory
+	fn_header
 fi
+fn_ut99filesdl
+fn_ut99install
+fn_loginstall
+fn_getquery
+fn_serverconfig
+fn_ut99fix
+fn_header
+fn_details
+fn_installcomplete
 }
 
-fn_autoip(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_logmanager(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_debugserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_console(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_backupserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_distro(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_uptime(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_load(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailnotification(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_emailtest(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_monitorserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restartserver(){
-fn_scriptlog "Restarting ${servername}"
-fn_stopserver
-fn_startserver
-}
-
-fn_stopserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_startserver(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_details(){
+fn_functions(){
+# Functions are defines in fn_functions.
 functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
 fn_runfunction(){
-# Download function if missing
+# Functions are downloaded and run with this function
 if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
 	cd "${rootdir}"
 	if [ ! -d "functions" ]; then
 		mkdir functions
 	fi
-	echo "loading ${functionfile}..."
 	cd functions
-	wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile}
+	echo -e "loading ${functionfile}...\c"
+	wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
 	chmod +x "${functionfile}"
 	cd "${rootdir}"
 	sleep 1
-	echo ""
 fi
-# Run function
 source "${rootdir}/functions/${functionfile}"
 }
 
-fn_ut99compressmaps(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-#
-## Installer
-#
-
-fn_ut99fix(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_header(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_ut99filesdl(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-fn_ut99install(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_loginstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getquery(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_retryinstall(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverdirectory(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_serverconfig(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_install(){
-fn_rootcheck
-fn_header
-if [ -z "${autoinstall}" ]; then
-	fn_serverdirectory
-	fn_header
-fi
-fn_ut99filesdl
-fn_ut99install
-fn_loginstall
-fn_getquery
-fn_serverconfig
-fn_ut99fix
-fn_header
-fn_details
-echo "================================="
-echo "Install Complete!"
-echo ""
-echo "To start server type:"
-echo "${selfname} start"
-echo ""
-}
+fn_functions
 
 case "$1" in
 	start)