소스 검색

Merge remote-tracking branch 'dgibbs64/master'

Alexander Hurd 10 년 전
부모
커밋
d686320c19
100개의 변경된 파일3532개의 추가작업 그리고 6424개의 파일을 삭제
  1. 55 39
      7DaysToDie/sdtdserver
  2. 60 37
      ARKSurvivalEvolved/arkserver
  3. 53 36
      Arma3/arma3server
  4. 59 37
      BlackMesa/bmdmserver
  5. 53 36
      BladeSymphony/bsserver
  6. 57 40
      BrainBread2/bb2server
  7. 155 0
      CodenameCURE/ccserver
  8. 105 0
      CodenameCURE/cfg/lgsm-default.cfg
  9. 53 36
      CounterStrike/csserver
  10. 53 36
      CounterStrikeConditionZero/csczserver
  11. 54 37
      CounterStrikeGlobalOffensive/csgoserver
  12. 53 36
      CounterStrikeSource/cssserver
  13. 53 36
      DayOfDefeat/dodserver
  14. 53 36
      DayOfDefeatSource/dodsserver
  15. 53 36
      DeathmatchClassic/dmcserver
  16. 55 38
      DontStarveTogether/dstserver
  17. 54 37
      DoubleActionBoogaloo/dabserver
  18. 53 36
      FistfulOfFrags/fofserver
  19. 1 1
      GarrysMod/cfg/lgsm-default.cfg
  20. 61 38
      GarrysMod/gmodserver
  21. 55 39
      GoldenEyeSource/gesserver
  22. 53 36
      HalfLife2Deathmatch/hl2dmserver
  23. 53 36
      HalfLifeDeathmatch/hldmserver
  24. 53 36
      HalfLifeDeathmatchSource/hldmsserver
  25. 54 37
      Hurtworld/hwserver
  26. 54 37
      Insurgency/insserver
  27. 54 36
      JustCause2/jc2server
  28. 53 36
      KillingFloor/kfserver
  29. 53 36
      Left4Dead/l4dserver
  30. 56 36
      Left4Dead2/l4d2server
  31. 53 37
      Mumble/mumbleserver
  32. 57 39
      NS2Combat/ns2cserver
  33. 57 39
      NaturalSelection2/ns2server
  34. 53 36
      NoMoreRoomInHell/nmrihserver
  35. 53 36
      OpposingForce/opforserver
  36. 53 36
      PiratesVikingandKnightsII/pvkiiserver
  37. 0 0
      ProjectZomboid/cfg/lgsm-default.ini
  38. 58 37
      ProjectZomboid/pzserver
  39. 60 42
      QuakeLive/qlserver
  40. 6 5
      README.md
  41. 53 36
      RedOrchestra/roserver
  42. 53 36
      Ricochet/ricochetserver
  43. 48 0
      Rust/cfg/lgsm-default.cfg
  44. 175 0
      Rust/rustserver
  45. 53 36
      SeriousSam3BFE/ss3sserver
  46. 53 36
      StarBound/sbserver
  47. 54 37
      SvenCoop/svencoopserver
  48. 54 37
      TeamFortress2/tf2server
  49. 54 37
      TeamFortressClassic/tfcserver
  50. 52 36
      TeamSpeak3/ts3server
  51. 54 37
      Teeworlds/twserver
  52. 12 12
      Terraria/cfg/lgsm-default.txt
  53. 53 36
      Terraria/terrariaserver
  54. 53 36
      UnrealTournament2004/ut2k4server
  55. 61 43
      UnrealTournament99/ut99server
  56. 0 200
      functions/check_deps.sh
  57. 0 63
      functions/check_steamcmd.sh
  58. 0 23
      functions/check_steamuser.sh
  59. 0 64
      functions/command_backup.sh
  60. 0 632
      functions/command_details.sh
  61. 0 15
      functions/command_dev_debug.sh
  62. 0 22
      functions/command_email_test.sh
  63. 0 115
      functions/command_monitor.sh
  64. 0 194
      functions/command_start.sh
  65. 0 159
      functions/command_stop.sh
  66. 0 62
      functions/command_ts3_server_pass.sh
  67. 38 0
      functions/command_update_functions.sh
  68. 0 49
      functions/command_validate.sh
  69. 69 399
      functions/core_functions.sh
  70. 7 420
      functions/core_getopt.sh
  71. 0 148
      functions/core_messages.sh
  72. 0 70
      functions/email.sh
  73. 0 33
      functions/fix_arma3.sh
  74. 0 34
      functions/fix_dst.sh
  75. 0 144
      functions/fix_glibc.sh
  76. 4 9
      functions/fn_functions
  77. 5 6
      functions/fn_getopt
  78. 11 18
      functions/fn_update_functions
  79. 0 807
      functions/info_config.sh
  80. 0 10
      functions/info_ts3status.sh
  81. 0 54
      functions/install_dl_ut2k4.sh
  82. 0 54
      functions/install_dl_ut99.sh
  83. 0 42
      functions/install_gslt.sh
  84. 0 30
      functions/install_gsquery.sh
  85. 0 20
      functions/install_header.sh
  86. 0 87
      functions/install_serverfiles.sh
  87. 0 42
      functions/install_ut2k4.sh
  88. 0 19
      functions/install_ut2k4_key.sh
  89. 0 42
      functions/install_ut99.sh
  90. 0 65
      functions/logs.sh
  91. 0 97
      functions/monitor_gsquery.sh
  92. 0 318
      functions/update_check.sh
  93. 0 83
      functions/update_dl.sh
  94. 11 20
      functions/update_functions.sh
  95. BIN
      images/screens/DST_menu.png
  96. BIN
      images/screens/DST_title.png
  97. 0 0
      lgsm/functions/README.md
  98. 61 0
      lgsm/functions/alert.sh
  99. 241 0
      lgsm/functions/alert_email.sh
  100. 22 0
      lgsm/functions/alert_pushbullet.sh

+ 55 - 39
7DaysToDie/sdtdserver

@@ -2,22 +2,29 @@
 # 7 Days To Die
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -28,7 +35,7 @@ updateonstart="off"
 
 # http://7daystodie.gamepedia.com/Server
 fn_parms(){
-parms="-configfile=${servercfgfullpath} -dedicated"
+parms="-logfile ${gamelogdir}/output_log__`date +%Y-%m-%d__%H-%M-%S`.txt -quit -batchmode -nographics -dedicated -configfile=${servercfgfullpath}"
 }
 
 #### Advanced Variables ####
@@ -52,10 +59,12 @@ engine="unity3d"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
-executable="./startserver.sh"
+executable="./7DaysToDieServer.x86"
 servercfg="${servicename}.xml"
 servercfgdir="${filesdir}"
 servercfgfullpath="${servercfgdir}/${servercfg}"
@@ -67,6 +76,7 @@ logdays="7"
 gamelogdir="${rootdir}/log/server"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 gamelog="${gamelogdir}/${servicename}-game.log"
 scriptlog="${scriptlogdir}/${servicename}-script.log"
@@ -79,57 +89,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
-	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
+		exit 1
 	fi
+	chmod +x "${filedir}/${filename}"
 fi
-if [ "${exec}" ]; then
-	source "${filepath}"
-fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1
 core_getopt.sh
-

+ 60 - 37
ARKSurvivalEvolved/arkserver

@@ -2,32 +2,45 @@
 # ARK: Survivial Evolved
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
 
 # Start Variables
+servername="ark-server"
+port="7778"
+queryport="27015"
+rconport="32330"
+rconpassword="" # Set to enable rcon
+maxplayers="50"
 ip="0.0.0.0"
 updateonstart="off"
 
 fn_parms(){
-parms="TheIsland?listen"
+    parms="TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}"
 }
 
 #### Advanced Variables ####
@@ -51,6 +64,8 @@ engine="unreal4"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/ShooterGame"
 executabledir="${systemdir}/Binaries/Linux"
@@ -66,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -77,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
Arma3/arma3server

@@ -3,22 +3,29 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Contributor: Scarsz
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -71,6 +78,8 @@ engine="realvirtuality"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
@@ -89,6 +98,7 @@ logdays="7"
 #gamelogdir="" # No server logs available
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -100,55 +110,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 59 - 37
BlackMesa/bmdmserver

@@ -2,22 +2,29 @@
 # Black Mesa: Deathmatch
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -31,9 +38,14 @@ clientport="27005"
 ip="0.0.0.0"
 updateonstart="off"
 
+# Optional: Game Server Login Token
+# GSLT can be used for running a public server.
+# More info: https://gameservermanagers.com/gslt
+gslt=""
+
 # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
 fn_parms(){
-parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
+parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
 }
 
 #### Advanced Variables ####
@@ -57,6 +69,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/bms"
 executabledir="${filesdir}"
@@ -72,6 +86,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +98,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
-	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
+		exit 1
 	fi
+	chmod +x "${filedir}/${filename}"
 fi
-if [ "${exec}" ]; then
-	source "${filepath}"
-fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
BladeSymphony/bsserver

@@ -2,22 +2,29 @@
 # Blade Symphony
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -57,6 +64,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/berimbau"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 57 - 40
BrainBread2/bb2server

@@ -2,22 +2,29 @@
 # BrainBread 2
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="090116"
+version="030616"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -31,9 +38,9 @@ clientport="27005"
 ip="0.0.0.0"
 updateonstart="off"
 
-# Required: Game Server Login Token
-# GSLT is required for running a public server.
-# More info: http://gameservermanagers.com/gslt
+# Optional: Game Server Login Token
+# GSLT can be used for running a public server.
+# More info: https://gameservermanagers.com/gslt
 gslt=""
 
 # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
@@ -51,7 +58,7 @@ githubrepo="linuxgsm"
 githubbranch="master"
 
 # Steam
-appid="346330"
+appid="475370"
 
 # Server Details
 servicename="bb2-server"
@@ -62,6 +69,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/brainbread2"
 executabledir="${filesdir}"
@@ -77,6 +86,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -88,55 +98,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 155 - 0
CodenameCURE/ccserver

@@ -0,0 +1,155 @@
+#!/bin/bash
+# Codename CURE
+# Server Management Script
+# Author: Daniel Gibbs
+# Website: https://gameservermanagers.com
+if [ -f ".dev-debug" ]; then
+	exec 5>dev-debug.log
+	BASH_XTRACEFD="5"
+	set -x
+fi
+
+version="210516"
+
+#### Variables ####
+
+# Notification Alerts
+# (on|off)
+
+# Email
+emailalert="off"
+email="email@example.com"
+
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
+# Steam login
+steamuser="anonymous"
+steampass=""
+
+# Start Variables
+defaultmap="cbe_bunker"
+maxplayers="6"
+port="27015"
+sourcetvport="27020"
+clientport="27005"
+ip="0.0.0.0"
+updateonstart="off"
+
+# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
+fn_parms(){
+parms="-game cure -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
+}
+
+#### Advanced Variables ####
+
+# Github Branch Select
+# Allows for the use of different function files
+# from a different repo and/or branch.
+githubuser="dgibbs64"
+githubrepo="linuxgsm"
+githubbranch="master"
+
+# Steam
+appid="383410"
+
+# Server Details
+servicename="cc-server"
+gamename="Codename CURE"
+engine="source"
+
+# Directories
+rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
+selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
+filesdir="${rootdir}/serverfiles"
+systemdir="${filesdir}/cure"
+executabledir="${filesdir}"
+executable="./srcds_run"
+servercfg="${servicename}.cfg"
+servercfgdir="${systemdir}/cfg"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+servercfgdefault="${servercfgdir}/lgsm-default.cfg"
+backupdir="${rootdir}/backups"
+
+# Logging
+logdays="7"
+gamelogdir="${systemdir}/logs"
+scriptlogdir="${rootdir}/log/script"
+consolelogdir="${rootdir}/log/console"
+consolelogging="on"
+
+scriptlog="${scriptlogdir}/${servicename}-script.log"
+consolelog="${consolelogdir}/${servicename}-console.log"
+emaillog="${scriptlogdir}/${servicename}-email.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"
+
+##### Script #####
+# Do not edit
+
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
+	if [ ! -d "${filedir}" ]; then
+		mkdir -p "${filedir}"
+	fi
+	echo -e "    fetching ${filename}...\c"
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
+		echo -e "\e[0;31mFAIL\e[0m\n"
+		echo "Curl is not installed!"
+		echo -e ""
+		exit 1
+	fi
+	chmod +x "${filedir}/${filename}"
+fi
+source "${filedir}/${filename}"
+}
+
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
+}
+
+core_functions.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
+}
+
+core_dl.sh
+core_functions.sh
+
+getopt=$1
+core_getopt.sh

+ 105 - 0
CodenameCURE/cfg/lgsm-default.cfg

@@ -0,0 +1,105 @@
+// ****************************************************************************
+//                                                                            *
+//     CodenameCURE - server.cfg                                              *
+//     Version 100216                                                         *
+//                                                                            *
+// ****************************************************************************
+
+// ............................. Basic Settings ............................. //
+
+// Hostname for server.
+hostname "<hostname>"
+
+// RCON - remote console password.
+rcon_password "<rconpassword>"
+
+// Server password - for private servers.
+sv_password ""
+
+// Contact email for server sysop.
+sv_contact "email@example.com"
+
+// LAN Mode - If set the server will not show on the internet.
+// Default: sv_lan 0
+sv_lan 0
+
+// ............................... Map Cycles ............................... //
+// info: There are several predefined mapcycles available that are listed below.
+// You can also create your own custom mapcycle. 
+
+// "mapcycle.txt" - all maps
+mapcyclefile "mapcycle.txt"
+
+// ........................ Game Specific Commands ........................ //
+// info: any commands that only apply to this game.
+
+// Difficulty
+// 0 - Easy 
+// 1 - Average 
+// 2 - Skilled 
+// 3 - Insane
+sv_difficulty "1"
+
+// Server tags - Tags show up on the in-game server browser. This helps 
+// users filter servers.
+// 		vanilla - he server runs the default settings.
+// 		custom - the server runs custom gameplay settings or mods.
+// example: sv_tags "custom, fastdl"
+sv_tags ""
+
+// ............................. Communication ............................. //
+
+// Enable communication over voice via microphone.
+// Default: sv_voiceenable 1
+sv_voiceenable 1
+
+// Players can hear all other players, no team restrictions.
+// Default: sv_alltalk 0
+sv_alltalk 1
+
+// ............................. Fast Download .............................. //
+// info: Allows custom maps to be downloaded to the client.
+
+// Allows clients to download custom maps and textures etc. from the server at 20 kbps.
+// Default: sv_allowdownload 1
+sv_allowdownload 1
+
+// Allows clients to download custom maps, textures etc. from a web server with no transfer limit.
+// Example:
+// 		server location: maps/custommap.bsp
+// 		web server location: http://example.com/custom/maps/custommap.bsp
+//		sv_downloadurl "http://example.com/custom"
+// Default: sv_downloadurl ""
+sv_downloadurl ""
+
+// ................................ Ban List ............................... //
+
+// personal banlist based on user IDs.
+exec banned_user.cfg
+
+// personal banlist based on user IPs.	
+exec banned_ip.cfg
+
+writeid
+writeip
+
+// ............................. Server Logging ............................. //
+
+//Enables logging to file, console, and udp < on | off >.
+log on
+
+// Log server bans in the server logs.
+// Default: sv_logbans 1
+sv_logbans 1
+
+// Echo log information to the console.
+// Default: sv_logecho 1
+sv_logecho 1
+
+// Log server information in the log file.
+// Default: sv_logfile 1
+sv_logfile 1
+
+// Log server information to only one file.
+// Default: sv_log_onefile 0
+sv_log_onefile 0

+ 53 - 36
CounterStrike/csserver

@@ -2,22 +2,29 @@
 # Counter Strike
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="goldsource"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/cstrike"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
CounterStrikeConditionZero/csczserver

@@ -2,22 +2,29 @@
 # Counter Strike: Condition Zero
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="goldsource"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/czero"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 54 - 37
CounterStrikeGlobalOffensive/csgoserver

@@ -2,22 +2,29 @@
 # Counter Strike: Global Offensive
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -44,7 +51,7 @@ updateonstart="off"
 
 # Required: Game Server Login Token
 # GSLT is required for running a public server.
-# More info: http://gameservermanagers.com/gslt
+# More info: https://gameservermanagers.com/gslt
 gslt=""
 
 # Optional: Workshop Parameters
@@ -80,6 +87,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/csgo"
 executabledir="${filesdir}"
@@ -95,6 +104,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -106,55 +116,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
CounterStrikeSource/cssserver

@@ -2,22 +2,29 @@
 # Counter Strike: Source
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/cstrike"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
DayOfDefeat/dodserver

@@ -2,22 +2,29 @@
 # Day of Defeat
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="goldsource"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/dod"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
DayOfDefeatSource/dodsserver

@@ -2,22 +2,29 @@
 # Day of Defeat: Source
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/dod"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
DeathmatchClassic/dmcserver

@@ -2,22 +2,29 @@
 # Deathmatch Classic
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="goldsource"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/dmc"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 55 - 38
DontStarveTogether/dstserver

@@ -2,22 +2,29 @@
 # Dont Starve Together
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="130516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -26,12 +33,12 @@ steampass=""
 ip="0.0.0.0"
 updateonstart="off"
 
-
 # Overworld: -conf_dir DST_Overworld
 # Cave: -conf_dir DST_Cave
 #http://dont-starve-game.wikia.com/wiki/Guides/Don%E2%80%99t_Starve_Together_Dedicated_Servers
 fn_parms(){
-parms=""
+parms="-console -cluster MyDediServer -shard Master"
+# -console -cluster MyDediServer -shard Master
 }
 
 #### Advanced Variables ####
@@ -55,6 +62,8 @@ engine="dontstarve"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}/bin"
@@ -70,6 +79,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -81,55 +91,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
-	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
+		exit 1
 	fi
+	chmod +x "${filedir}/${filename}"
 fi
-if [ "${exec}" ]; then
-	source "${filepath}"
-fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 54 - 37
DoubleActionBoogaloo/dabserver

@@ -2,22 +2,29 @@
 # Double Action: Boogaloo
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -49,7 +56,7 @@ githubbranch="master"
 appid="317800"
 
 # Server Details
-servicename="da-server"
+servicename="dab-server"
 gamename="Double Action: Boogaloo"
 engine="source"
 
@@ -57,6 +64,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/dab"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
FistfulOfFrags/fofserver

@@ -2,22 +2,29 @@
 # Fistful Of Frags
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/fof"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 1 - 1
GarrysMod/cfg/lgsm-default.cfg

@@ -38,7 +38,7 @@ sv_allow_wait_command 0
 sv_allow_voice_from_file 0
 sv_turbophysics 0
 sv_max_usercmd_future_ticks 12
-gmod_physiterations 2
+gmod_physiterations 4
 sv_client_min_interp_ratio 1
 sv_client_max_interp_ratio 2
 think_limit 20

+ 61 - 38
GarrysMod/gmodserver

@@ -2,22 +2,29 @@
 # Garry's Mod
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -35,16 +42,21 @@ port="27015"
 sourcetvport="27020"
 clientport="27005"
 ip="0.0.0.0"
+tickrate="66"
 updateonstart="off"
 
+# Custom Start Parameters
+# Default +r_hunkalloclightmaps 0, fixes a start issue on maps with many lights
+customparms="+r_hunkalloclightmaps 0"
+
 # Optional: Game Server Login Token
 # GSLT can be used for running a public server.
-# More info: http://gameservermanagers.com/gslt
+# More info: https://gameservermanagers.com/gslt
 gslt=""
 
 # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
 fn_parms(){
-parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} +host_workshop_collection ${workshopcollectionid} -authkey ${workshopauth} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
+parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate {tickrate} +host_workshop_collection ${workshopcollectionid} -authkey ${workshopauth} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} ${customparms}"
 }
 
 #### Advanced Variables ####
@@ -68,8 +80,11 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/garrysmod"
+addonsdir="${systemdir}/addons"
 executabledir="${filesdir}"
 executable="./srcds_run"
 servercfg="${servicename}.cfg"
@@ -83,6 +98,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -94,55 +110,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
-	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
+		exit 1
 	fi
+	chmod +x "${filedir}/${filename}"
 fi
-if [ "${exec}" ]; then
-	source "${filepath}"
-fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 55 - 39
GoldenEyeSource/gesserver

@@ -2,24 +2,30 @@
 # GoldenEye: Source
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
-
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 export MALLOC_CHECK_=0
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -46,7 +52,7 @@ parms="-game gesource -strictportbind -ip ${ip} -port ${port} +clientport ${clie
 githubuser="dgibbs64"
 githubrepo="linuxgsm"
 githubbranch="master"
- 
+
 # Steam - 2007 SDK
 appid="310"
 
@@ -59,6 +65,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/gesource"
 executabledir="${filesdir}"
@@ -74,6 +82,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -85,56 +94,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1
-core_getopt.sh
+core_getopt.sh

+ 53 - 36
HalfLife2Deathmatch/hl2dmserver

@@ -2,22 +2,29 @@
 # Half Life 2: Deathmatch
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/hl2mp"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
HalfLifeDeathmatch/hldmserver

@@ -2,22 +2,29 @@
 # Half Life: Deathmatch
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -56,6 +63,8 @@ engine="goldsource"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/valve"
 executabledir="${filesdir}"
@@ -71,6 +80,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -82,55 +92,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
HalfLifeDeathmatchSource/hldmsserver

@@ -2,22 +2,29 @@
 # Half-Life Deathmatch: Source
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/hl1mp"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 54 - 37
Hurtworld/hwserver

@@ -3,22 +3,29 @@
 # Server Management Script
 # Author: Daniel Gibbs,
 # Contributor: UltimateByte
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -43,6 +50,7 @@ loadsave=""
 # Use unstable 64 bit server executable (O/1)
 x64mode="0"
 
+
 # http://hurtworld.wikia.com/wiki/Hosting_A_Server
 fn_parms(){
 parms="-batchmode -nographics -exec \"host ${port} ${map} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\" -logfile \"${logfile}\" "
@@ -69,6 +77,8 @@ engine="unity3d"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}"))
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
@@ -84,6 +94,7 @@ logdays="7"
 gamelogdir="${rootdir}/log/server"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 gamelog="${gamelogdir}/${servicename}-game.log"
 scriptlog="${scriptlogdir}/${servicename}-script.log"
@@ -96,57 +107,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "		${curl}"|grep "curl:"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1
 core_getopt.sh
-

+ 54 - 37
Insurgency/insserver

@@ -2,22 +2,29 @@
 # Insurgency
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -59,10 +66,12 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/insurgency"
 executabledir="${filesdir}"
-executable="./srcds_linux"
+executable="./srcds_run"
 servercfg="${servicename}.cfg"
 servercfgdir="${systemdir}/cfg"
 servercfgfullpath="${servercfgdir}/${servercfg}"
@@ -74,6 +83,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -85,55 +95,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 54 - 36
JustCause2/jc2server

@@ -2,22 +2,29 @@
 # Just Cause 2
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -50,6 +57,9 @@ engine="avalanche"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
+libdir="${lgsmdir}/lib"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
@@ -65,6 +75,7 @@ logdays="7"
 #gamelogdir="" # No server logs available
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -76,55 +87,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
KillingFloor/kfserver

@@ -2,22 +2,29 @@
 # Killing Floor
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -56,6 +63,8 @@ engine="unreal2"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/System"
 executabledir="${systemdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${rootdir}/log/server"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 gamelog="${gamelogdir}/${servicename}-game.log"
 scriptlog="${scriptlogdir}/${servicename}-script.log"
@@ -85,55 +95,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
Left4Dead/l4dserver

@@ -3,22 +3,29 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Contributor: Summit Singh Thakur
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/left4dead"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 56 - 36
Left4Dead2/l4d2server

@@ -2,22 +2,32 @@
 # Left 4 Dead 2
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
+# Pushover
+#Push alot
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -56,6 +66,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/left4dead2"
 executabledir="${filesdir}"
@@ -71,6 +83,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -82,55 +95,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
-	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
+		exit 1
 	fi
+	chmod +x "${filedir}/${filename}"
 fi
-if [ "${exec}" ]; then
-	source "${filepath}"
-fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 37
Mumble/mumbleserver

@@ -2,22 +2,29 @@
 # Mumble
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Server Details
 gamename="Mumble"
 servicename="mumble-server"
@@ -26,6 +33,8 @@ servicename="mumble-server"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
@@ -40,6 +49,7 @@ logdays="7"
 logdir="${rootdir}/log"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -62,57 +72,63 @@ githubbranch="master"
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
-	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
+		exit 1
 	fi
+	chmod +x "${filedir}/${filename}"
 fi
-if [ "${exec}" ]; then
-	source "${filepath}"
-fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1
 core_getopt.sh
-

+ 57 - 39
NS2Combat/ns2cserver

@@ -2,22 +2,29 @@
 # NS2: Combat
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="220416"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -32,8 +39,6 @@ servername="NS2C Server"
 webadminuser="admin"
 webadminpass="admin"
 webadminport="8080"
-configpath="server1"
-modstorage="server1/Workshop"
 mods=""
 password=""
 # Add the following line to the parms if you want a private server. Ensuring
@@ -42,7 +47,7 @@ password=""
 
 # http://wiki.unknownworlds.com/ns2/Dedicated_Server
 fn_parms(){
-parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${rootdir}/${configpath}\" -modstorage \"${rootdir}/${modstorage}\" -mods \"${mods}\""
+parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\""
 }
 
 #### Advanced Variables ####
@@ -66,10 +71,15 @@ engine="spark"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}/ia32"
 executable="./ns2combatserver_linux32"
+servercfgdir="${rootdir}/server1"
+servercfgfullpath="${servercfgdir}"
+modstoragedir="${servercfgdir}/Workshop"
 backupdir="${rootdir}/backups"
 
 # Logging
@@ -77,6 +87,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -88,55 +99,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 57 - 39
NaturalSelection2/ns2server

@@ -2,22 +2,29 @@
 # Natural Selection 2
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="220416"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -32,8 +39,6 @@ servername="NS2 Server"
 webadminuser="admin"
 webadminpass="admin"
 webadminport="8080"
-configpath="server1"
-modstorage="server1/Workshop"
 mods=""
 password=""
 # Add the following line to the parms if you want a private server. Ensuring
@@ -42,7 +47,7 @@ password=""
 
 # http://wiki.unknownworlds.com/ns2/Dedicated_Server
 fn_parms(){
-parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${rootdir}/${configpath}\" -modstorage \"${rootdir}/${modstorage}\" -mods \"${mods}\""
+parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\""
 }
 
 #### Advanced Variables ####
@@ -66,10 +71,15 @@ engine="spark"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
 executable="./server_linux32"
+servercfgdir="${rootdir}/server1"
+servercfgfullpath="${servercfgdir}"
+modstoragedir="${servercfgdir}/Workshop"
 backupdir="${rootdir}/backups"
 
 # Logging
@@ -77,6 +87,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -88,55 +99,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
NoMoreRoomInHell/nmrihserver

@@ -2,22 +2,29 @@
 # No More Room in Hell
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/nmrih"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
OpposingForce/opforserver

@@ -2,22 +2,29 @@
 # Half-Life: Opposing Force
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="goldsource"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/gearbox"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
PiratesVikingandKnightsII/pvkiiserver

@@ -2,22 +2,29 @@
 # No More Room in Hell
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/pvkii"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 0 - 0
ProjectZomboid/cfg/servertest.ini → ProjectZomboid/cfg/lgsm-default.ini


+ 58 - 37
ProjectZomboid/pzserver

@@ -3,25 +3,32 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Contributions: Bryce Van Dyk (SingingTree)
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
-steampass="password"
+steampass=""
 
 # Start Variables
 ip="0.0.0.0"
@@ -42,6 +49,9 @@ githubbranch="master"
 
 # Steam
 appid="380870"
+# Allows for opting into the various Steam branches that PZ has to offer
+# Example: -beta iwillbackupmysave -betapassword iaccepttheconsequences
+branch=""
 
 # Server Details
 servicename="pz-server"
@@ -52,6 +62,8 @@ engine="projectzomboid"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
@@ -59,6 +71,7 @@ executable="./start-server.sh"
 servercfg="servertest.ini"
 servercfgdir="${HOME}/Zomboid/Server"
 servercfgfullpath="${servercfgdir}/${servercfg}"
+servercfgdefault="${servercfgdir}/lgsm-default.ini"
 backupdir="${rootdir}/backups"
 
 # Logging
@@ -66,6 +79,7 @@ logdays="7"
 gamelogdir="${HOME}/Zomboid/Logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -77,55 +91,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 60 - 42
QuakeLive/qlserver

@@ -2,32 +2,40 @@
 # Quake Live
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="060516"
 
 #### Variables ####
-arch="x64"
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
 
 # Start Variables
-gameport="27960"
+arch="x64" # x64 or x86
+port="27960"
 rconport="28960"
-rcon_password='ch@ng3me'
-stats_password='ch@ng3me'
+rconpassword="CHANGE_ME"
+statsport="${port}"
+statspassword="CHANGE_ME"
 mappool='mappool.txt'
 ip="0.0.0.0"
 updateonstart="off"
@@ -35,7 +43,7 @@ updateonstart="off"
 # Install/Config Guide : https://steamcommunity.com/sharedfiles/filedetails/?id=542966946
 # Console Commands : http://www.regurge.at/ql/
 fn_parms(){
-	parms="+set net_strict 1 +set net_ip ${ip} +set net_port ${gameport} +set fs_homepath ${filesdir}/${gameport} +set zmq_rcon_enable 1 +set zmq_rcon_port ${rconport} +set zmq_rcon_password ${rcon_password} +set zmq_stats_enable 1 +set zmq_stats_password ${stats_password} +set zmq_stats_port ${gameport} +set sv_mapPoolFile ${mappool} +exec ${servercfg} "
+	parms="+set net_strict 1 +set net_ip ${ip} +set net_port ${port} +set fs_homepath ${filesdir}/${port} +set zmq_rcon_enable 1 +set zmq_rcon_port ${rconport} +set zmq_rcon_password ${rconpassword} +set zmq_stats_enable 1 +set zmq_stats_password ${statspassword} +set zmq_stats_port ${statsport} +set sv_mapPoolFile ${mappool} +exec ${servercfg}"
 }
 
 #### Advanced Variables ####
@@ -59,10 +67,12 @@ engine="idtech3"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
-executable=$([ "$arch" == 'x64' ] && echo "./run_server_x64.sh" || echo "./run_server_x86.sh")
+executable=$([ "${arch}" == 'x64' ] && echo "./run_server_x64.sh" || echo "./run_server_x86.sh")
 servercfg="${servicename}.cfg"
 servercfgdir="${filesdir}/baseq3"
 servercfgfullpath="${servercfgdir}/${servercfg}"
@@ -74,6 +84,7 @@ logdays="7"
 gamelogdir="${rootdir}/log/server"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 gamelog="${gamelogdir}/${servicename}-game.log"
 scriptlog="${scriptlogdir}/${servicename}-script.log"
@@ -86,55 +97,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 6 - 5
README.md

@@ -1,10 +1,10 @@
 <h1>Linux Game Server Managers_</h1>
-<a href="http://gameservermanagers.com"><img src="https://github.com/dgibbs64/linuxgsm/blob/master/images/logo/lgsm-full-light.png" alt="linux Game Server Managers" width="600" /></a>
+<a href="https://gameservermanagers.com"><img src="https://github.com/dgibbs64/linuxgsm/blob/master/images/logo/lgsm-full-light.png" alt="linux Game Server Managers" width="600" /></a>
 
 [![Build Status](https://travis-ci.org/dgibbs64/linuxgsm.svg?branch=master)](https://travis-ci.org/dgibbs64/linuxgsm)
 [![Under Development](https://badge.waffle.io/dgibbs64/linuxgsm.svg?label=Under%20Development&title=Under%20Development)](http://waffle.io/dgibbs64/linuxgsm)
 
-The Linux Game Server Managers are command line tools for quick, simple deployment and management of various dedicated game servers and voice comms servers.
+The Linux Game Server Managers are command line tools for quick, simple deployment and management of various dedicated game servers and voice alert servers.
 
 <h2>Hassle-Free Dedicated Servers</h2>
 Game servers traditionally are not easy to manage yourself. Admins often have to spend hours just messing around trying to get their server working. LGSM is designed to be a simple as possible allowing Admins to spend less time on management and more time on the fun stuff.
@@ -15,7 +15,8 @@ Game servers traditionally are not easy to manage yourself. Admins often have to
 	<li>Console</li>
 	<li>Details</li>
 	<li>Installer (SteamCMD)</li>
-	<li>Monitor (including email notification)</li>
+	<li>Monitor</li>
+	<li>Alerts (Email, Pushbullet)</li>
 	<li>Update (SteamCMD)</li>
 	<li>Start/Stop/Restart server</li>
 </ul>
@@ -38,11 +39,11 @@ All FAQ can be found here.
 <h2>Donate</h2>
 If you want to donate to the project you can via PayPal, Flattr or Gratipay. I have had a may kind people show their support by sending me a donation. Any donations you send help cover my server costs and buy me a drink. Cheers!
 <ul>
-<li><a href="http://gameservermanagers.com/#donate">Donate</a></li>
+<li><a href="https://gameservermanagers.com/#donate">Donate</a></li>
 </ul>
 <h2>Useful Links</h2>
 <ul>
-	<li><a href="http://gameservermanagers.com">Homepage</li>
+	<li><a href="https://gameservermanagers.com">Homepage</li>
 	<li><a href="https://github.com/dgibbs64/linuxgsm/wiki">Wiki</li>
 	<li><a href="https://github.com/dgibbs64/linuxgsm">GitHub Code</li>
 	<li><a href="https://github.com/dgibbs64/linuxgsm/issues">GitHub Issues</li>

+ 53 - 36
RedOrchestra/roserver

@@ -2,22 +2,29 @@
 # Red Orchestra: Ostfront 41-45
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -52,6 +59,8 @@ appid="223250"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/system"
 executabledir="${systemdir}"
@@ -68,6 +77,7 @@ logdays="7"
 gamelogdir="${rootdir}/log/server"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 gamelog="${gamelogdir}/${servicename}-game.log"
 scriptlog="${scriptlogdir}/${servicename}-script.log"
@@ -81,55 +91,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
Ricochet/ricochetserver

@@ -2,22 +2,29 @@
 # Ricochet
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -57,6 +64,8 @@ engine="goldsource"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/ricochet"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 48 - 0
Rust/cfg/lgsm-default.cfg

@@ -0,0 +1,48 @@
+# This file does not include all possible commands but it includes the most common/useful ones.
+# If you want to see all possible comands, in the server console type: find .
+
+# Before some variables are a # symbol. This means it is disabled. Remove the # symbol to enable them.
+
+#########################################
+# Important Settings You Need To Change #
+#########################################
+
+#  A text description of your server. For a new line add:  \n
+server.description "LGSM Server\nRust support : UltimateByte"
+
+# A URL to the image which shows up on the server details screen (dimensions are 512x256).
+server.headerimage "https://github.com/dgibbs64/linuxgsm/raw/master/images/logo/lgsm-full-light.png"
+
+# The URL to your servers website.
+server.url "https://gameservermanagers.com/"
+
+####################################
+# Optional Settings You Can Change #
+####################################
+
+# A value of false makes text chat location based only (players need to be close to each other).
+# Values: true, false
+#server.globalchat true
+
+# Controls if player vs player damage is allowed. If your server is primarily for building, you'll want to set this to false
+# Values: true, false
+#server.pve false
+
+# Controls fall damage.
+# Values: true, false
+#falldamage.enabled true
+
+# Helicopter bullet accuracy. Higher numbers are less accurate.
+#heli.bulletAccuracy 2
+
+################################################
+# Settings That Will Lag Server Is Set Too Low #
+################################################
+
+# Changes how often resources respawn.
+#spawn.min_rate 0.1
+#spawn.max_rate 1
+
+# Changes how close resources spawn to each other.
+#spawn.min_density 0.1
+#spawn.max_density 1

+ 175 - 0
Rust/rustserver

@@ -0,0 +1,175 @@
+#!/bin/bash
+# Rust
+# Server Management Script
+# Author: Daniel Gibbs
+# Contributor: UltimateByte (LGSM adaptation), Wulf (Information)
+# Website: https://gameservermanagers.com
+if [ -f ".dev-debug" ]; then
+	exec 5>dev-debug.log
+	BASH_XTRACEFD="5"
+	set -x
+fi
+
+version="210516"
+
+#### Variables ####
+
+# Notification Alerts
+# (on|off)
+
+# Email
+emailalert="off"
+email="email@example.com"
+
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
+# Steam login (not required)
+steamuser="anonymous"
+steampass=""
+
+# Server settings
+# More settings available after install in serverfiles/server/rust-server/server.cfg
+servername="Rust"
+ip="0.0.0.0"
+updateonstart="off"
+port="28015"
+rconport="28016"
+rconpassword="CHANGE_ME"
+maxplayers="50"
+
+# Advanced
+seed="" #  default random; range : -2147483647 to 2147483647 ; used to change or reproduce a procedural map
+worldsize="4000" # default 4000; range : 2000 to 8000 ; map size in meters
+saveinterval="300" # Auto-save in seconds
+tickrate="30" # default 30; range : 15 to 100
+
+# https://developer.valvesoftware.com/wiki/Rust_Dedicated_Server
+fn_parms(){
+parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile ${gamelogfile}"
+}
+
+# Specific to Rust
+if [ -n "${seed}" ]; then
+	# If set, then add to start parms
+	conditionalseed="+server.seed ${seed}"
+else
+	# Keep randomness of the number if not set
+	conditionalseed=""
+fi
+
+#### Advanced Variables ####
+
+# Github Branch Select
+# Allows for the use of different function files
+# from a different repo and/or branch.
+githubuser="dgibbs64"
+githubrepo="linuxgsm"
+githubbranch="master"
+
+# Steam
+appid="258550"
+
+# Server Details
+servicename="rust-server"
+gamename="Rust"
+engine="unity3d"
+
+# Directories
+rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
+selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}"))
+lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
+filesdir="${rootdir}/serverfiles"
+systemdir="${filesdir}"
+executabledir="${filesdir}"
+executable="./RustDedicated"
+serveridentitydir="${systemdir}/server/${servicename}"
+servercfg="server.cfg"
+servercfgdir="${serveridentitydir}/cfg"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+servercfgdefault="${servercfgdir}/lgsm-default.cfg"
+backupdir="${rootdir}/backups"
+
+# Logging
+logdays="7"
+gamelogdir="${rootdir}/log/server"
+scriptlogdir="${rootdir}/log/script"
+consolelogdir="${rootdir}/log/console"
+consolelogging="on"
+
+gamelog="${gamelogdir}/${servicename}-game.log"
+scriptlog="${scriptlogdir}/${servicename}-script.log"
+consolelog="${consolelogdir}/${servicename}-console.log"
+emaillog="${scriptlogdir}/${servicename}-email.log"
+gamelogfile="\"gamelog-$(date '+%Y-%m-%d-%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"
+
+##### Script #####
+# Do not edit
+
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
+	if [ ! -d "${filedir}" ]; then
+		mkdir -p "${filedir}"
+	fi
+	echo -e "    fetching ${filename}...\c"
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
+		echo -e "\e[0;31mFAIL\e[0m\n"
+		echo "Curl is not installed!"
+		echo -e ""
+		exit 1
+	fi
+	chmod +x "${filedir}/${filename}"
+fi
+source "${filedir}/${filename}"
+}
+
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
+}
+
+core_functions.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
+}
+
+core_dl.sh
+core_functions.sh
+
+getopt=$1
+core_getopt.sh

+ 53 - 36
SeriousSam3BFE/ss3sserver

@@ -2,22 +2,29 @@
 # Serious Sam 3: BFE
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="121215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -52,6 +59,8 @@ engine="seriousengine35"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/Bin"
 executable="./runSam3_DedicatedServer.sh"
@@ -67,6 +76,7 @@ logdays="7"
 gamelogdir="${rootdir}/log/server"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 gamelog="${gamelogdir}/${servicename}-game.log"
 scriptlog="${scriptlogdir}/${servicename}-script.log"
@@ -80,55 +90,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
StarBound/sbserver

@@ -2,22 +2,29 @@
 # Starbound
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -51,6 +58,8 @@ engine="starbound"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}/linux64"
@@ -65,6 +74,7 @@ logdays="7"
 gamelogdir="${filesdir}/giraffe_storage"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -76,55 +86,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 54 - 37
SvenCoop/svencoopserver

@@ -2,22 +2,29 @@
 # Sven Co-op
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -56,6 +63,8 @@ engine="goldsource"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/svencoop"
 executabledir="${filesdir}"
@@ -71,6 +80,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -82,56 +92,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1
-core_getopt.sh
+core_getopt.sh

+ 54 - 37
TeamFortress2/tf2server

@@ -2,22 +2,29 @@
 # Team Fortress 2
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -33,7 +40,7 @@ updateonstart="off"
 
 # Optional: Game Server Login Token
 # GSLT can be used for running a public server.
-# More info: http://gameservermanagers.com/gslt
+# More info: https://gameservermanagers.com/gslt
 gslt=""
 
 # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
@@ -62,6 +69,8 @@ engine="source"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/tf"
 executabledir="${filesdir}"
@@ -77,6 +86,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -88,55 +98,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 54 - 37
TeamFortressClassic/tfcserver

@@ -2,22 +2,29 @@
 # Team Fortress Classic
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="anonymous"
 steampass=""
@@ -46,7 +53,7 @@ githubbranch="master"
 
 # Steam
 appid="90"
-appidmos="tfc"
+appidmod="tfc"
 
 # Server Details
 servicename="tfc-server"
@@ -57,6 +64,8 @@ engine="goldsource"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/tfc"
 executabledir="${filesdir}"
@@ -72,6 +81,7 @@ logdays="7"
 gamelogdir="${systemdir}/logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 52 - 36
TeamSpeak3/ts3server

@@ -2,22 +2,29 @@
 # Teamspeak 3
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="251215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Start Variables
 updateonstart="off"
 
@@ -30,6 +37,8 @@ servicename="ts3-server"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
@@ -60,55 +69,62 @@ githubbranch="master"
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 54 - 37
Teeworlds/twserver

@@ -3,22 +3,29 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Contributor: Bryce Van Dyk (SingingTree)
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -52,6 +59,8 @@ engine="teeworlds"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
@@ -67,6 +76,7 @@ logdays="7"
 gamelogdir="${rootdir}/log/server"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 gamelog="${gamelogdir}/${servicename}-game.log"
 scriptlog="${scriptlogdir}/${servicename}-script.log"
@@ -75,59 +85,66 @@ emaillog="${scriptlogdir}/${servicename}-email.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"
- 
+
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
-	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
+		exit 1
 	fi
+	chmod +x "${filedir}/${filename}"
 fi
-if [ "${exec}" ]; then
-	source "${filepath}"
-fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 12 - 12
Terraria/cfg/lgsm-default.txt

@@ -22,40 +22,40 @@
 #remove the # in front of commands to enable them.
 
 #Load a world and automatically start the server.
-#world=C:\Users\YOUR_USERNAME_HERE\My Documents\My Games\Terraria\Worlds\world1.wld
+world=~/.local/share/Terraria/Worlds/world1.wld
 
 #Creates a new world if none is found. World size is specified by: 1(small), 2(medium), and 3(large).
-#autocreate=1
+autocreate=1
 
 #Sets the name of the world when using autocreate
-#worldname=Terraria
+worldname=Terraria
 
 #Sets the difficulty of the world when using autocreate 0(normal), 1(expert)
-#difficulty=1
+difficulty=0
 
 #Sets the max number of players allowed on a server.  Value must be between 1 and 255
-#maxplayers=8
+maxplayers=8
 
 #Set the port number
-#port=7777
+port=7777
 
 #Set the server password
-#password=p@55w0rd
+password=p@55w0rd
 
 #Set the message of the day
-#motd=Please don’t cut the purple trees!
+motd=Please don’t cut the purple trees!
 
 #Sets the folder where world files will be stored
-#worldpath=C:\Users\Defaults\My Documents\My Games\Terraria\Worlds\
+worldpath=~/.local/share/Terraria/Worlds/
 
 #The location of the banlist. Defaults to "banlist.txt" in the working directory.
-#banlist=banlist.txt
+banlist=banlist.txt
 
 #Adds addition cheat protection.
-#secure=1
+secure=1
 
 #Sets the server language 1:English, 2:German, 3:Italian, 4:French, 5:Spanish
-#lang=1
+lang=1
 
 #Automatically forward ports with uPNP
 #upnp=1

+ 53 - 36
Terraria/terrariaserver

@@ -3,22 +3,29 @@
 # Server Management Script
 # Author: Daniel Gibbs
 # Contributor: Bryce Van Dyk (SingingTree)
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Steam login
 steamuser="username"
 steampass="password"
@@ -52,6 +59,8 @@ engine="terraria"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
@@ -67,6 +76,7 @@ logdays="7"
 #gamelogdir="" # Terraria Doesn't Have a Server Log
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -78,55 +88,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 53 - 36
UnrealTournament2004/ut2k4server

@@ -2,22 +2,29 @@
 # Unreal Tournament 2004
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="271215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Start Variables
 defaultmap="DM-Rankin"
 ip="0.0.0.0"
@@ -35,6 +42,8 @@ engine="unreal2"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/System"
 executabledir="${systemdir}"
@@ -51,6 +60,7 @@ logdays="7"
 gamelogdir="${rootdir}/log/server"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 gamelog="${gamelogdir}/${servicename}-game.log"
 scriptlog="${scriptlogdir}/${servicename}-script.log"
@@ -71,55 +81,62 @@ githubbranch="master"
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 61 - 43
UnrealTournament99/ut99server

@@ -2,22 +2,29 @@
 # Unreal Tournament 99
 # Server Management Script
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
+# Website: https://gameservermanagers.com
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-version="121215"
+version="210516"
 
 #### Variables ####
 
-# Notification Email
+# Notification Alerts
 # (on|off)
-emailnotification="off"
+
+# Email
+emailalert="off"
 email="email@example.com"
 
+# Pushbullet 
+# https://www.pushbullet.com/#settings
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+
 # Start Variables
 defaultmap="DM-Deck16]["
 ip="0.0.0.0"
@@ -28,6 +35,13 @@ parms="server ${defaultmap}.unr ini=${servercfgfullpath}"
 
 #### Advanced Variables ####
 
+# Github Branch Select
+# Allows for the use of different function files
+# from a different repo and/or branch.
+githubuser="dgibbs64"
+githubrepo="linuxgsm"
+githubbranch="master"
+
 # Server Details
 servicename="ut99-server"
 gamename="Unreal Tournament 99"
@@ -37,6 +51,8 @@ engine="unreal"
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}/System"
 executabledir="${systemdir}"
@@ -50,8 +66,10 @@ backupdir="${rootdir}/backups"
 
 # Logging
 logdays="7"
+gamelogdir="${filesdir}/Logs"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
+consolelogging="on"
 
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
@@ -60,65 +78,65 @@ emaillog="${scriptlogdir}/${servicename}-email.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"
 
-# Github Branch Select
-# Allows for the use of different function files
-# from a different repo and/or branch.
-githubuser="dgibbs64"
-githubrepo="linuxgsm"
-githubbranch="master"
-
 ##### Script #####
 # Do not edit
 
-fn_getgithubfile(){
-filename=$1
-exec=$2
-fileurl=${3:-$filename}
-filepath="${rootdir}/${filename}"
-filedir=$(dirname "${filepath}")
-# If the function file is missing, then download
-if [ ! -f "${filepath}" ]; then
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
 	if [ ! -d "${filedir}" ]; then
-		mkdir "${filedir}"
+		mkdir -p "${filedir}"
 	fi
-	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}"
 	echo -e "    fetching ${filename}...\c"
-	if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then
-		:
-	else	
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi		
+	else
 		echo -e "\e[0;31mFAIL\e[0m\n"
 		echo "Curl is not installed!"
 		echo -e ""
-		exit
+		exit 1
 	fi
-	curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1)
-	if [ $? -ne 0 ]; then
-		echo -e "\e[0;31mFAIL\e[0m\n"
-		echo "${curl}"
-		echo -e "${githuburl}\n"
-		exit
-	else
-		echo -e "\e[0;32mOK\e[0m"
-	fi	
-	if [ "${exec}" ]; then
-		chmod +x "${filepath}"
-	fi
-fi
-if [ "${exec}" ]; then
-	source "${filepath}"
+	chmod +x "${filedir}/${filename}"
 fi
+source "${filedir}/${filename}"
 }
 
-fn_runfunction(){
-	fn_getgithubfile "functions/${functionfile}" 1
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
+core_dl.sh
 core_functions.sh
 
 getopt=$1

+ 0 - 200
functions/check_deps.sh

@@ -1,200 +0,0 @@
-#!/bin/bash
-# LGSM check_deps.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="310116"
-
-# Description: Checks that the requires dependencies are installed for LGSM.
-
-
-fn_deps_detector(){
-# Checks if dependency is missing
-if [ -n "$(command -v dpkg-query)" ]; then
-	dpkg-query -W -f='${Status}' ${deptocheck} 2>/dev/null| grep -q -P '^install ok installed$'
-	depstatus=$?
-elif [ -n "$(command -v yum)" ]; then
-	yum -q list installed ${deptocheck} > /dev/null 2>&1
-	depstatus=$?
-fi	
-if [ "${depstatus}" == "0" ]; then
-	missingdep=0
-	if [ "${function_selfname}" == "command_install.sh" ]; then
-		echo -e "\e[0;32m${deptocheck}\e[0m"
-		sleep 0.5
-	fi
-else
-	# if missing dependency is found
-	missingdep=1
-	if [ "${function_selfname}" == "command_install.sh" ]; then
-		echo -e "\e[0;31m${deptocheck}\e[0m"
-		sleep 0.5
-	fi	
-fi
-
-# Missing dependencies are added to array_deps_missing
-if [ "${missingdep}" == "1" ]; then
-	array_deps_missing+=("${deptocheck}")
-fi
-}
-
-fn_deps_email(){
-# Adds postfix to required dependencies if email notification is enabled
-if [ "${emailnotification}" == "on" ]; then
-	if [ -n "$(command -v dpkg-query)" ]; then
-		array_deps_required+=( mailutils postfix )
-	elif [ -n "$(command -v yum)" ]; then
-		array_deps_required+=( mailx postfix )
-	fi	
-fi
-}
-
-fn_found_missing_deps(){
-if [ "${#array_deps_missing[@]}" != "0" ]; then
-	fn_printdots "Checking dependencies"
-	sleep 2
-	fn_printwarn "Checking dependencies: Dependency missing: \e[0;31m${array_deps_missing[@]}\e[0m"
-	sleep 1
-	echo -e ""
-	sudo -n true > /dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		fn_printinfonl "Attempting to install missing dependencies automatically"
-		echo -en ".\r"
-		sleep 1
-		echo -en "..\r"
-		sleep 1
-		echo -en "...\r"
-		sleep 1
-		echo -en "   \r"	
-		if [ -n "$(command -v dpkg-query)" ]; then
-			echo "sudo dpkg --add-architecture i386; sudo apt-get install ${array_deps_missing[@]}"
-		elif [ -n "$(command -v yum)" ]; then
-			echo "yum install ${array_deps_missing[@]}"
-		fi	
-	else
-		echo ""
-		fn_printinfomationnl "$(whoami) does not have sudo access. manually install dependencies"
-		echo ""
-		if [ -n "$(command -v dpkg-query)" ]; then
-			echo "sudo dpkg --add-architecture i386; sudo apt-get install ${array_deps_missing[@]}"
-		elif [ -n "$(command -v yum)" ]; then
-			echo "yum install ${array_deps_missing[@]}"
-		fi	
-		echo ""
-	fi
-	if [ "${function_selfname}" == "command_install.sh" ]; then
-		sleep 5
-	fi
-fi	
-}
-
-fn_check_loop(){
-	# Loop though required depenencies
-	for deptocheck in "${array_deps_required[@]}"
-	do
-		fn_deps_detector
-	done
-
-	# user to be informaed of any missing dependecies 
-	fn_found_missing_deps
-}
-
-if [ "${function_selfname}" == "command_install.sh" ]; then
-	echo ""
-	echo "Checking Dependecies"
-	echo "================================="
-fi
-
-
-# Check will only run if using apt-get or yum
-if [ -n "$(command -v dpkg-query)" ]; then
-	# Generate array of missing deps
-	array_deps_missing=()
-
-	# LGSM requirement for curl
-	array_deps_required=( curl ca-certificates )
-
-	# All servers except ts3 require tmux
-	if [ "${executable}" != "./ts3server_startscript.sh" ]; then
-		array_deps_required+=( tmux )
-	fi
-
-	# All servers excelts ts3 & mumble require libstdc++6,lib32gcc1
-	if [ "${executable}" != "./ts3server_startscript.sh" ]||[ "${executable}" != "./murmur.x86" ]; then
-		array_deps_required+=( lib32gcc1 libstdc++6:i386 )
-	fi
-
-	# Game Specific requirements
-
-	# Spark
-	if [ "${engine}" ==  "spark" ]; then
-		array_deps_required+=( speex:i386 libtbb2 )
-	# 7 Days to Die	
-	elif [ "${executable}" ==  "./7DaysToDie.sh" ]; then
-		array_deps_required+=( telnet expect )
-	# No More Room in Hell	
-	elif [ "${gamename}" == "No More Room in Hell" ]; then
-		array_deps_required+=( lib32tinfo5 )
-	# Brainbread 2 and Don't Starve Together
-	elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then
-		array_deps_required+=( libcurl4-gnutls-dev:i386 )
-	elif [ "${engine}" ==  "projectzomboid" ]; then
-		array_deps_required+=( openjdk-7-jre )
-	# Unreal engine
-	elif [ "${executable}" ==  "./ucc-bin" ]; then
-		#UT2K4
-		if [ -f "${executabledir}/ut2004-bin" ]; then
-			array_deps_required+=( libsdl1.2debian libstdc++5:i386 bzip2 unzip )
-		#UT99
-		else
-			array_deps_required+=( libsdl1.2debian bzip2 )
-		fi	
-	fi
-	fn_deps_email
-	fn_check_loop
-
-elif [ -n "$(command -v yum)" ]; then
-	# Generate array of missing deps
-	array_deps_missing=()
-
-	# LGSM requirement for curl
-	array_deps_required=( curl )
-
-	# All servers except ts3 require tmux
-	if [ "${executable}" != "./ts3server_startscript.sh" ]; then
-		array_deps_required+=( tmux )
-	fi
-
-	# All servers excelts ts3 & mumble require libstdc++6,lib32gcc1
-	if [ "${executable}" != "./ts3server_startscript.sh" ]||[ "${executable}" != "./murmur.x86" ]; then
-		array_deps_required+=( glibc.i686 libstdc++.i686 )
-	fi
-
-	# Game Specific requirements
-
-	# Spark
-	if [ "${engine}" ==  "spark" ]; then
-		array_deps_required+=( speex.i686 tbb.i686 )
-	# 7 Days to Die	
-	elif [ "${executable}" ==  "./7DaysToDie.sh" ]; then
-		array_deps_required+=( telnet expect )
-	# No More Room in Hell	
-	elif [ "${gamename}" == "No More Room in Hell" ]; then
-		array_deps_required+=( ncurses-libs.i686 )
-	# Brainbread 2 and Don't Starve Together
-	elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then
-		array_deps_required+=( libcurl.i686 )
-	elif [ "${engine}" ==  "projectzomboid" ]; then
-		array_deps_required+=( java-1.7.0-openjdk )
-	# Unreal engine
-	elif [ "${executable}" ==  "./ucc-bin" ]; then
-		#UT2K4
-		if [ -f "${executabledir}/ut2004-bin" ]; then
-			array_deps_required+=( compat-libstdc++-33.i686 SDL.i686 bzip2 unzip )
-		#UT99
-		else
-			array_deps_required+=( SDL.i686 bzip2 )
-		fi	
-	fi
-	fn_deps_email
-	fn_check_loop
-fi

+ 0 - 63
functions/check_steamcmd.sh

@@ -1,63 +0,0 @@
-#!/bin/bash
-# LGSM check_steamcmd.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="281215"
-
-# Description: Downloads SteamCMD on install and checks if missing before running functions that require SteamCMD
-
-
-if [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 2004" ]||[ "${gamename}" == "Mumble" ]||[ "${gamename}" == "Teamspeak 3" ]; then
-	: # These servers do not require SteamCMD. Check is skipped.
-else
-	# Checks steamuser is setup. 
-	if [ "${steamuser}" == "username" ]; then
-	fn_printfailnl "Steam login not set. Update steamuser."	
-	echo "	* Change steamuser=\"username\" to a valid steam login."
-	if [ -d ${scriptlogdir} ]; then
-		fn_scriptlog "edit ${selfname}. change steamuser=\"username\" to a valid steam login."
-		exit 1
-	fi
-	fi
-	if [ -z "${steamuser}" ]; then
-		fn_printwarnnl "Steam login not set. Using anonymous login."
-		if [ -d "${scriptlogdir}" ]; then
-			fn_scriptlog "Steam login not set. Using anonymous login."
-		fi
-		steamuser="anonymous"
-		steampass=""
-		sleep 2
-	fi	
-	# Checks if SteamCMD exists when starting or updating a server.
-	# Re-installs if missing.
-	steamcmddir="${rootdir}/steamcmd"
-	if [ ! -f "${steamcmddir}/steamcmd.sh" ]; then
-		fn_printwarnnl "SteamCMD is missing"
-		fn_scriptlog "SteamCMD is missing"
-		sleep 1
-		if [ ! -d "${steamcmddir}" ]; then
-			mkdir -v "${steamcmddir}"
-		fi
-		curl=$(curl --fail -o "${steamcmddir}/steamcmd_linux.tar.gz" "http://media.steampowered.com/client/steamcmd_linux.tar.gz" 2>&1)
-		exitcode=$?
-		echo -e "downloading steamcmd_linux.tar.gz...\c"
-		if [ $exitcode -eq 0 ]; then
-			fn_printokeol
-		else
-			fn_printfaileol
-			echo "${curl}"
-			echo -e "${githuburl}\n"
-			exit $exitcode
-		fi
-		tar --verbose -zxf "${steamcmddir}/steamcmd_linux.tar.gz" -C "${steamcmddir}"
-		rm -v "${steamcmddir}/steamcmd_linux.tar.gz"
-		chmod +x "${steamcmddir}/steamcmd.sh"
-	fi		
-	if [ "${function_selfname}" == "command_update.sh" ]||[ "${function_selfname}" == "command_validate.sh" ]; then
-		# Checks that steamcmd is working correctly and will prompt Steam Guard if required.
-		"${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit
-		if [ $? -ne 0 ]; then
-			fn_printfailurenl "Error running SteamCMD"	
-		fi		
-	fi	
-fi

+ 0 - 23
functions/check_steamuser.sh

@@ -1,23 +0,0 @@
-#!/bin/bash
-# LGSM check_steamuser.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-if [ "${steamuser}" == "username" ]; then
-	fn_printfailnl "Steam login not set. Update steamuser."	
-	echo "	* Change steamuser=\"username\" to a valid steam login."
-	if [ -d ${scriptlogdir} ]; then
-		fn_scriptlog "edit ${selfname}. change steamuser=\"username\" to a valid steam login."
-		exit 1
-	fi
-fi
-if [ -z "${steamuser}" ]; then
-	fn_printwarnnl "Steam login not set. Using anonymous login."
-	if [ -d "${scriptlogdir}" ]; then
-		fn_scriptlog "Steam login not set. Using anonymous login."
-	fi
-	steamuser="anonymous"
-	steampass=""
-	sleep 2
-fi

+ 0 - 64
functions/command_backup.sh

@@ -1,64 +0,0 @@
-#!/bin/bash
-# LGSM command_backup.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-# Description: Creates a .tar.gz file in the backup directory.
-
-local modulename="Backup"
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-check.sh
-backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')"
-echo ""
-echo "${gamename} Backup"
-echo "============================"
-echo ""
-echo "The following backup will be created:"
-echo ""
-echo "${backupdir}/${backupname}.tar.gz"
-echo ""
-while true; do
-	read -p "Continue? [y/N]" yn
-	case $yn in
-	[Yy]* ) break;;
-	[Nn]* ) echo Exiting; return;;
-	* ) echo "Please answer yes or no.";;
-esac
-done
-tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
-if [ "${tmuxwc}" -eq 1 ]; then
-	echo ""
-	fn_printwarningnl "${servicename} is currently running."
-	sleep 1
-	while true; do
-		read -p "Stop ${servicename} while running the backup? [y/N]" yn
-		case $yn in
-		[Yy]* ) command_stop.sh; break;;
-		[Nn]* ) break;;
-		* ) echo "Please answer yes or no.";;
-	esac
-	done
-fi
-fn_scriptlog "Started"
-echo -en "starting backup.\r"
-sleep 1
-echo -en "starting backup..\r"
-sleep 1
-echo -en "starting backup...\r"
-sleep 1
-echo -en "\n"
-cd "${rootdir}"
-if [ ! -d "${backupdir}" ]; then
-	mkdir -v "${backupdir}"
-fi
-tar -cvzf "${backupdir}/${backupname}.tar.gz" --exclude "${backupdir}" ./*
-echo ""
-echo "Backup created: ${backupdir}/${backupname}.tar.gz"
-fn_scriptlog "Created: ${backupdir}/${backupname}.tar.gz"
-sleep 1
-echo ""
-fn_printcompletenl "Complete."
-fn_scriptlog "Complete"
-echo ""

+ 0 - 632
functions/command_details.sh

@@ -1,632 +0,0 @@
-#!/bin/bash
-# LGSM command_details.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="060116"
-
-# Description: Displays server infomation.
-
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-# Standard Details
-# This applies to all engines
-
-fn_details_os(){
-echo -e ""
-echo -e "\e[93mDistro Details\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-{
-	echo -e "\e[34mDistro:\t\e[0m${os}"
-	echo -e "\e[34mArch:\t\e[0m${arch}"
-	echo -e "\e[34mKernel:\t\e[0m${kernel}"
-	echo -e "\e[34mHostname:\t\e[0m$HOSTNAME"
-	echo -e "\e[34mtmux:\t\e[0m${tmuxv}"
-	echo -e "\e[34mGLIBC:\t\e[0m${glibcv}"
-} | column -s $'\t' -t 
-}
-
-fn_details_performance(){
-echo -e ""
-echo -e "\e[93mPerformance\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-{
-	echo -e "\e[34mUptime:\t\e[0m${days}d, ${hours}h, ${minutes}m"
-	echo -e "\e[34mAvg Load:\t\e[0m${load}"
-} | column -s $'\t' -t 
-echo -e ""
-{
-	echo -e "\e[34mMem:\t\e[34mtotal\t used\t free\e[0m"
-	echo -e "\e[34mPhysical:\t\e[0m${physmemtotal}\t${physmemused}\t${physmemfree}\e[0m"
-	echo -e "\e[34mSwap:\t\e[0m${swaptotal}\t${swapused}\t${swapfree}\e[0m"
-} | column -s $'\t' -t 
-}
-
-fn_details_disk(){
-echo -e ""
-echo -e "\e[93mStorage\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-{
-	echo -e "\e[34mFilesystem:\t\e[0m${filesystem}"
-	echo -e "\e[34mTotal:\t\e[0m${totalspace}"
-	echo -e "\e[34mUsed:\t\e[0m${usedspace}"
-	echo -e "\e[34mAvailable:\t\e[0m${availspace}"
-	echo -e "\e[34mServerfiles:\t\e[0m${filesdirdu}"
-	if [ -d "${backupdir}" ]; then
-		echo -e "\e[34mBackups:\t\e[0m${backupdirdu}"
-	fi
-} | column -s $'\t' -t 
-}
-
-fn_details_gameserver(){
-echo -e ""
-
-## server details
-echo -e "\e[92m${gamename} Server Details\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-{
-	# server name
-	echo -e "\e[34mServer name:\t\e[0m${servername}"
-
-	# server ip
-	echo -e "\e[34mServer IP:\t\e[0m${ip}:${port}"
-
-	# rcon password
-	if [ -n "${rconpassword}" ]; then
-		echo -e "\e[34mRCON password:\t\e[0m${rconpassword}"
-	fi
-
-	# server password
-	if [ -n "${serverpassword}" ]; then
-		echo -e "\e[34mServer password:\t\e[0m${serverpassword}"
-	fi
-
-	# admin password
-	if [ -n "${adminpassword}" ]; then
-		echo -e "\e[34mAdmin password:\t\e[0m${adminpassword}"
-	fi
-
-	# slots
-	if [ -n "${slots}" ]; then
-		echo -e "\e[34mSlots:\t\e[0m${slots}"
-	fi
-
-	# game mode
-	if [ -n "${gamemode}" ]; then
-		echo -e "\e[34mGame mode:\t\e[0m${gamemode}"
-	fi
-
-	# game world
-	if [ -n "${gameworld}" ]; then
-		echo -e "\e[34mGame world:\t\e[0m${gameworld}"
-	fi
-
-	# tick rate
-	if [ -n "${tickrate}" ]; then
-		echo -e "\e[34mTick rate:\t\e[0m${tickrate}"
-	fi
-
-	# online status
-	if [ "${gamename}" == "Teamspeak 3" ]; then
-		info_ts3status.sh
-		if [ "${ts3status}" = "Server seems to have died" ]||[ "${ts3status}"	= "No server running (ts3server.pid is missing)" ]; then
-			echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m"
-		else
-			echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m"
-		fi
-	else
-		pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
-		if [ "${pid}" == "0" ]; then
-			echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m"
-		else
-			echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m"
-		fi
-	fi
-
-	# teamspeak dbplugin
-	if [ -n "${dbplugin}" ]; then
-		echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}"
-	fi
-} | column -s $'\t' -t 
-echo -e ""
-
-## script details
-echo -e "\e[92m${selfname} Script Details\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-{
-	# service name
-	echo -e "\e[34mService name:\t\e[0m${servicename}"
-
-	# script version
-	if [ -n "${version}" ]; then
-		echo -e "\e[34m${selfname} version:\t\e[0m${version}"
-	fi
-
-	# script user
-	echo -e "\e[34mUser:\t\e[0m$(whoami)"
-
-	# GLIBC required
-	if [ -n "${glibcrequired}" ]; then
-		if [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt "$(echo "${glibcrequired}" | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" ]; then
-			if [ "${glibcfix}" == "yes" ]; then
-				echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)"
-			else
-				echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired}\e[0m(\e[0;32mGLIBC version too old\e[0m)"
-			fi
-		else
-			echo -e "\e[34mGLIBC required:\t\e[0;32m${glibcrequired}\e[0m"
-		fi
-	fi
-
-	# email notification
-	if [ -n "${emailnotification}" ]; then
-		echo -e "\e[34mEmail notification:\t\e[0m${emailnotification}"
-	fi
-
-	# update on start
-	if [ -n "${updateonstart}" ]; then
-		echo -e "\e[34mUpdate on start:\t\e[0m${updateonstart}"
-	fi
-
-	# script location
-	echo -e "\e[34mLocation:\t\e[0m${rootdir}"
-
-	# config file location
-	if [ -n "${servercfgfullpath}" ]; then
-		echo -e "\e[34mConfig file:\t\e[0m${servercfgfullpath}"
-	fi
-
-	# network config file location (ARMA 3)
-	if [ -n "${networkcfgfullpath}" ]; then
-		echo -e "\e[34mNetwork config file:\t\e[0m${networkcfgfullpath}"
-	fi
-} | column -s $'\t' -t 
-}
-
-fn_details_backup(){
-echo -e ""
-echo -e "\e[92mBackups\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
-	echo -e "No Backups created"
-else
-	{
-		echo -e "\e[34mNo. of backups:\t\e[0m${backupcount}"
-		echo -e "\e[34mLatest backup:\e[0m"
-		echo -e "\e[34m    date:\t\e[0m${lastbackupdate}"
-		echo -e "\e[34m    file:\t\e[0m${lastbackup}"
-		echo -e "\e[34m    size:\t\e[0m${lastbackupsize}"
-	} | column -s $'\t' -t 
-fi
-}
-
-fn_details_commandlineparms(){
-echo -e ""
-echo -e "\e[92mCommand-line Parameters\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "${executable} ${parms}"
-}
-
-fn_details_statusbottom(){
-echo -e ""
-if [ "${gamename}" == "Teamspeak 3" ]; then
-	if [ "${ts3status}" = "Server seems to have died" ]||[ "${ts3status}"	= "No server running (ts3server.pid is missing)" ]; then
-        echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m"
-	else
-		echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m"
-	fi
-else
-	pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
-	if [ "${pid}" == "0" ]; then
-		echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m"
-	else
-		echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m"
-	fi
-fi
-echo -e ""
-}
-
-# Engine Specific details
-
-fn_details_avalanche(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the parameters in"
-echo -e "${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep Jcmp-Server"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game\tINBOUND\t${port}\tudp"
-} | column -s $'\t' -t 
-
-fn_details_statusbottom
-}
-
-fn_details_dontstarve(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the parameters in"
-echo -e "${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep dontstarve"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game\tINBOUND\t${port}\tudp"
-} | column -s $'\t' -t 
-
-fn_details_statusbottom
-}
-
-fn_details_projectzomboid(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the parameters in"
-echo -e "${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep java"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game\tINBOUND\t${port}\tudp"
-} | column -s $'\t' -t 
-
-fn_details_statusbottom
-}
-
-
-fn_details_realvirtuality(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the parameters in"
-echo -e "${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep arma3server"
-echo -e ""
-if [ -z "${port}" ]||[ -z "${queryport}" ]||[ -z "${masterport}" ]; then
-	echo -e "\e[0;31mERROR!\e[0m Missing/commented ports in ${servercfg}."
-	echo -e ""
-fi
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game\tINBOUND\t${port}\tudp"
-	echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
-	echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp"
-} | column -s $'\t' -t 
-
-fn_details_statusbottom
-}
-
-fn_details_seriousengine35(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the parameters in"
-echo -e "${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep Sam3_Dedicate"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
-	echo -e "> Query\tINBOUND\t${queryport}\tudp"
-} | column -s $'\t' -t 
-
-fn_details_statusbottom
-}
-
-fn_details_source(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the command-line"
-echo -e "parameters in ${selfname}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep srcds_linux"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
-	if [ -n "${sourcetvport}" ]; then
-	        echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
-	fi
-	echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
-} | column -s $'\t' -t
-
-fn_details_statusbottom
-}
-
-fn_details_spark(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the command-line"
-echo -e "parameters in ${selfname}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep server_linux3"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
-	echo -e "> Query\tINBOUND\t${queryport}\tudp"
-	echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
-} | column -s $'\t' -t
-echo -e ""
-echo -e "\e[92m${servername} WebAdmin\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-{
-	echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}/index.html"
-	echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}"
-	echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
-} | column -s $'\t' -t
-
-fn_details_statusbottom
-}
-
-fn_details_starbound(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the command-line"
-echo -e "parameters in ${selfname}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep starbound"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game\tINBOUND\t${port}\ttcp"
-	echo -e "> Query\tINBOUND\t${queryport}\ttcp"
-	echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
-} | column -s $'\t' -t
-
-fn_details_statusbottom
-
-}
-
-fn_details_teamspeak3(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the parameters in"
-echo -e "${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep ts3server"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Voice\tINBOUND\t${port}\tudp"
-	echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
-	echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
-} | column -s $'\t' -t
-
-fn_details_statusbottom
-}
-
-fn_details_teeworlds(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the command-line"
-echo -e "parameters in ${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep teeworlds_srv"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game\tINBOUND\t${port}\ttcp"
-} | column -s $'\t' -t
-
-fn_details_statusbottom
-}
-
-fn_details_terraria(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the command-line"
-echo -e "parameters in ${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep terraia"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game\tINBOUND\t${port}\ttcp"
-	echo -e "> Query\tINBOUND\t${queryport}\ttcp"
-	echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
-} | column -s $'\t' -t
-
-fn_details_statusbottom
-}
-
-fn_details_sdtd(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the parameters in"
-echo -e "${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep 7DaysToDie"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
-	echo -e "> Query\tINBOUND\t${queryport}\tudp"
-	echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
-	echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
-} | column -s $'\t' -t
-echo -e ""
-echo -e "\e[92m${servername} WebAdmin\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-{
-	echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}"
-	echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}"
-	echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
-} | column -s $'\t' -t
-echo -e ""
-echo -e "\e[92m${servername} Telnet\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-{
-	echo -e "\e[34mTelnet enabled:\t\e[0m${telnetenabled}"
-	echo -e "\e[34mTelnet address:\t\e[0m${ip} ${telnetport}"
-	echo -e "\e[34mTelnet password:\t\e[0m${telnetpass}"
-} | column -s $'\t' -t
-
-fn_details_statusbottom
-}
-
-fn_details_hurtworld(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the parameters in"
-echo -e "hwserver script"
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep Hurtworld"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-	echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
-	echo -e "> Query\tINBOUND\t${queryport}\tudp"
-
-} | column -s $'\t' -t
-echo -e ""
-
-fn_details_statusbottom
-}
-
-fn_details_unreal(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the parameters in"
-echo -e "${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep ucc-bin"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
-	echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
-	echo -e "> Query\tINBOUND\t${queryport}\tudp"
-	if [ "${engine}" == "unreal" ]; then
-		echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
-	fi
-	if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
-		echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
-	fi
-	if [ "${appid}" == "215360" ]; then
-		echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
-	else
-		echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
-	fi
-	if [ "${appid}" ]; then
-		if [ "${appid}" == "223250" ]; then
-			echo -e "< Steam\tOUTBOUND\t20610\tudp"
-		else
-			echo -e "< Steam\tOUTBOUND\t20660\tudp"
-		fi
-	fi
-	echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
-} | column -s $'\t' -t
-echo -e ""
-echo -e "\e[92m${servername} WebAdmin\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-{
-	echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}"
-	echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}"
-	echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}"
-	echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
-} | column -s $'\t' -t
-
-fn_details_statusbottom
-}
-
-fn_details_ark(){
-echo -e ""
-echo -e "\e[92mPorts\e[0m"
-printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
-echo -e "Change ports by editing the parameters in"
-echo -e "${servercfgfullpath}."
-echo -e ""
-echo -e "Useful port diagnostic command:"
-echo -e "netstat -atunp | grep ShooterGame"
-echo -e ""
-{
-	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
-	echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
-	echo -e "> Query\tINBOUND\t${queryport}\tudp"
-} | column -s $'\t' -t
-
-fn_details_statusbottom
-}
-
-
-# Run checks and gathers details to display.
-check.sh 
-info_config.sh
-info_distro.sh
-info_glibc.sh
-fn_details_os
-fn_details_performance
-fn_details_disk
-fn_details_gameserver
-fn_details_backup
-# Some game servers do not have parms.
-if [ "${gamename}" != "Teamspeak 3" ]||[ "${engine}" != "avalanche" ]||[ "${engine}" != "dontstarve" ]||[ "${engine}" == "projectzomboid" ]; then
-	fn_parms
-	fn_details_commandlineparms
-fi
-
-
-# Display details depending on game or engine.
-if [ "${engine}" == "avalanche" ]; then
-	fn_details_avalanche
-elif [ "${engine}" == "dontstarve" ]; then
-		fn_details_dontstarve
-elif [ "${engine}" == "projectzomboid" ]; then
-	fn_details_projectzomboid
-elif [ "${engine}" == "realvirtuality" ]; then
-	fn_details_realvirtuality
-elif [ "${engine}" == "seriousengine35" ]; then
-	fn_details_seriousengine35
-elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
-	fn_details_source
-elif [ "${engine}" == "spark" ]; then
-	fn_details_spark
-elif [ "${engine}" == "starbound" ]; then
-	fn_details_starbound
-elif [ "${engine}" == "teeworlds" ]; then
-	fn_details_teeworlds
-elif [ "${engine}" == "terraria" ]; then
-	fn_details_terraria
-elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
-	fn_details_unreal
-elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
-	fn_details_ark
-elif [ "${gamename}" == "Hurtworld" ]; then
-	fn_details_hurtworld
-elif [ "${gamename}" == "7 Days To Die" ]; then
-	fn_details_sdtd
-elif [ "${gamename}" == "Teamspeak 3" ]; then
-	fn_details_teamspeak3
-else
-	fn_printerrornl "Unable to detect server engine."
-fi

+ 0 - 15
functions/command_dev_debug.sh

@@ -1,15 +0,0 @@
-#!/bin/bash
-# LGSM dev_debug.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="281215"
-
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-if [ -f ".dev-debug" ]; then
-	rm .dev-debug
-	fn_printoknl "Disabled dev-debug"
-else
-	date > .dev-debug
-	fn_printoknl "Enabled dev-debug"
-fi

+ 0 - 22
functions/command_email_test.sh

@@ -1,22 +0,0 @@
-#!/bin/bash
-# LGSM command_email_test.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-# Description: Sends a test email notification.
-
-local modulename="Email"
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-check.sh
-info_config.sh
-if [ "${emailnotification}" = "on" ]; then
-	fn_scriptlog "Sending test notification"
-	subject="${servicename} Email Test Notification - Testing ${servername}"
-	failurereason="Testing ${servicename} email notification"
-	actiontaken="Sent test email...hello is this thing on?"
-	email.sh
-else
-	fn_printfailnl "Notifications not enabled"
-	fn_scriptlog "Notifications not enabled"
-fi

+ 0 - 115
functions/command_monitor.sh

@@ -1,115 +0,0 @@
-#!/bin/bash
-# LGSM command_monitor.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-# Description: Monitors server by checking for running proccesses
-# then passes to monitor_gsquery.sh.
-
-local modulename="Monitor"
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-fn_monitor_teamspeak3(){
-check.sh
-logs.sh
-fn_printdots "${servername}"
-fn_scriptlog "${servername}"
-sleep 1
-if [ ! -f "${rootdir}/${lockselfname}" ]; then
-	fn_printinfo "Disabled: No lock file found"
-	fn_scriptlog "Disabled: No lock file found"
-	sleep 1
-	echo -en "\n"
-	echo "To enable monitor run ./${selfname} start"
-	exit 1
-fi
-fn_printdots "Checking session: CHECKING"
-fn_scriptlog "Checking session: CHECKING"
-sleep 1
-info_ts3status.sh
-if [ "${ts3status}" = "Server is running" ]; then
-	fn_printok "Checking session: OK"
-	fn_scriptlog "Checking session: OK"
-	sleep 1
-	sleep 0.5
-	echo -en "\n"
-	exit
-else
-	fn_printfail "Checking session: FAIL"
-	fn_scriptlog "Checking session: FAIL"
-	sleep 1
-	fn_printfail "Checking session: FAIL: ${ts3status}"
-	fn_scriptlog "Checking session: FAIL: ${ts3status}"
-	failurereason="${ts3status}"
-	if [ "${emailnotification}" = "on" ]; then
-		subject="${servicename} Monitor - Restarting ${servername}"
-		actiontaken="restarted ${servername}"
-		email.sh
-	fi
-fi
-sleep 0.5
-echo -en "\n"
-fn_restart
-}
-
-fn_monitor_tmux(){
-check.sh
-info_config.sh
-fn_printdots "${servername}"
-fn_scriptlog "${servername}"
-sleep 1
-if [ ! -f "${rootdir}/${lockselfname}" ]; then
-	fn_printinfo "Disabled: No lock file found"
-	fn_scriptlog "Disabled: No lock file found"
-	sleep 1
-	echo -en "\n"
-	echo "To enable monitor run ./${selfname} start"
-	exit 1
-fi
-
-updatecheck=$(ps -ef|grep "${selfname} update"|grep -v grep|wc -l)
-if [ "${updatecheck}" = "0" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 2004" ]; then
-	fn_printdots "Checking session: CHECKING"
-	fn_scriptlog "Checking session: CHECKING"
-	sleep 1
-	tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
-	if [ "${tmuxwc}" -eq 1 ]; then
-		fn_printok "Checking session: OK"
-		fn_scriptlog "Checking session: OK"
-		sleep 1
-		echo -en "\n"
-
-		if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
-			monitor_gsquery.sh
-		fi
-		exit $?
-	else
-		fn_printfail "Checking session: FAIL"
-		fn_scriptlog "Checking session: FAIL"
-		sleep 1
-		echo -en "\n"
-		if [ "${emailnotification}" = "on" ]; then
-			subject="${servicename} Monitor - Starting ${servername}"
-			failurereason="${servicename} process not running"
-			actiontaken="${servicename} has been restarted"
-			email.sh
-		fi
-		fn_scriptlog "Monitor is starting ${servername}"
-		command_start.sh
-	fi
-else
-	fn_printinfonl "SteamCMD is currently checking for updates"
-	fn_scriptlog "SteamCMD is currently checking for updates"
-	sleep 1
-	fn_printinfonl "When update is complete ${servicename} will start"
-	fn_scriptlog "When update is complete ${servicename} will start"
-	sleep 1
-fi
-}
-
-if [ "${gamename}" == "Teamspeak 3" ]; then
-	fn_monitor_teamspeak3
-else
-	fn_monitor_tmux
-fi

+ 0 - 194
functions/command_start.sh

@@ -1,194 +0,0 @@
-#!/bin/bash
-# LGSM command_start.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="070116"
-
-# Description: Starts the server.
-
-local modulename="Starting"
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-fn_start_teamspeak3(){
-check.sh
-info_ts3status.sh
-
-if [ "${ts3status}" != "Server is running" ]; then
-	# Will check for updates is updateonstart is yes
-	if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then
-		update_check.sh
-	fi	
-fi
-
-if [ ! -e "${servercfgfullpath}" ]; then
-	fn_printwarn "${servercfgfullpath} is missing"
-	fn_scriptlog "${servercfgfullpath} is missing"
-	sleep 2
-	echo -en "\n"
-	echo  "	* Creating blank ${servercfg}"
-	fn_scriptlog "Creating blank ${servercfg}"
-	sleep 2
-	echo  "	* ${servercfg} can remain blank by default."
-	fn_scriptlog "${servercfgfullpath} can remain blank by default."
-	sleep 2
-	echo  "	* ${servercfg} is located in ${servercfgfullpath}."
-	fn_scriptlog "${servercfg} is located in ${servercfgfullpath}."
-	sleep 5
-	touch "${servercfgfullpath}"
-fi
-
-logs.sh
-
-fn_printdots "${servername}"
-fn_scriptlog "${servername}"
-sleep 1
-
-if [ "${ts3status}" == "Server is running" ]; then
-	fn_printinfo "${servername} is already running"
-	fn_scriptlog "${servername} is already running"
-	sleep 1
-	echo -en "\n"
-	exit
-fi
-
-mv "${scriptlog}" "${scriptlogdate}"
-# Create lock file
-date > "${rootdir}/${lockselfname}"
-cd "${executabledir}"
-if [ "${ts3serverpass}" == "1" ];then
-	./ts3server_startscript.sh start serveradmin_password="${newpassword}" 
-else
-	./ts3server_startscript.sh start inifile="${servercfgfullpath}" > /dev/null 2>&1
-fi
-sleep 1
-info_ts3status.sh
-if [ "${ts3status}" = "Server seems to have died" ]||[ "${ts3status}"	= "No server running (ts3server.pid is missing)" ]; then
-	fn_printfailnl "Unable to start ${servername}"
-	fn_scriptlog "Unable to start ${servername}"
-	echo -e "	Check log files: ${rootdir}/log"
-	exit 1
-else
-	fn_printok "${servername}"
-	fn_scriptlog "Started ${servername}"
-fi
-sleep 0.5
-echo -en "\n"
-}
-
-fn_start_tmux(){
-check.sh
-fix.sh
-info_config.sh
-fn_parms
-logs.sh
-
-tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
-# Will check for updates if updateonstart is yes
-if [ "${tmuxwc}" -eq 0 ]; then
-	if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then
-		update_check.sh
-	fi
-fi
-
-fn_printdots "${servername}"
-fn_scriptlog "${servername}"
-sleep 1
-
-if [ "${tmuxwc}" -eq 0 ]; then
-	fn_scriptlog "Rotating log files"
-	if [ "${engine}" == "unreal2" ]; then
-		mv "${gamelog}" "${gamelogdate}"
-	fi
-	mv "${scriptlog}" "${scriptlogdate}"
-	mv "${consolelog}" "${consolelogdate}"
-fi
-
-if [ "${tmuxwc}" -eq 1 ]; then
-	fn_printinfo "${servername} is already running"
-	fn_scriptlog "${servername} is already running"
-	sleep 1
-	echo -en "\n"
-	exit
-fi
-
-# Create lock file
-date > "${rootdir}/${lockselfname}"
-cd "${executabledir}"
-tmux new-session -d -s "${servicename}" "${executable} ${parms}" 2> "${scriptlogdir}/.${servicename}-tmux-error.tmp"
-# tmux pipe-pane not supported in tmux versions < 1.6
-if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then
-	echo "Console logging disabled: Tmux => 1.6 required" >> "${consolelog}"
-	echo "http://gameservermanagers.com/tmux-upgrade" >> "${consolelog}"
-	echo "Currently installed: $(tmux -V)" >> "${consolelog}"
-elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ]; then
-	echo "Console logging disabled: Bug in tmux 1.8 breaks logging" >> "${consolelog}"
-	echo "http://gameservermanagers.com/tmux-upgrade" >> "${consolelog}"
-	echo "Currently installed: $(tmux -V)" >> "${consolelog}"
-else
-	touch "${consolelog}"
-	tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'"
-fi
-sleep 1
-tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:")
-# If the server fails to start
-if [ "${tmuxwc}" -eq 0 ]; then
-	fn_printfailnl "Unable to start ${servername}"
-	fn_scriptlog "Unable to start ${servername}"
-	sleep 1
-	if [ -s "${scriptlogdir}/.${servicename}-tmux-error.tmp" ]; then
-		fn_printfailnl "Unable to start ${servername}: Tmux error:"
-		fn_scriptlog "Tmux error"
-		sleep 1
-		echo -en "\n"
-		echo ""
-		echo "Command"
-		echo "================================="
-		echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\""
-		echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" >> "${scriptlog}"
-		echo ""
-		echo "Error"
-		echo "================================="
-		cat "${scriptlogdir}/.${servicename}-tmux-error.tmp"
-		cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" >> "${scriptlog}"
-
-		# Detected error http://gameservermanagers.com/issues
-		if [ $(grep -c "Operation not permitted" "${scriptlogdir}/.${servicename}-tmux-error.tmp") ]; then
-		echo ""
-		echo "Fix"
-		echo "================================="
-			if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ]; then
-				echo "$(whoami) is not part of the tty group."
-				fn_scriptlog "$(whoami) is not part of the tty group."
-				group=$(grep tty /etc/group)
-				echo ""
-				echo "	${group}"
-				fn_scriptlog "${group}"
-				echo ""
-				echo "Run the following command with root privileges."
-				echo ""
-				echo "	usermod -G tty $(whoami)"
-				echo ""
-				echo "http://gameservermanagers.com/tmux-op-perm"
-				fn_scriptlog "http://gameservermanagers.com/tmux-op-perm"
-			else
-				echo "No known fix currently. Please log an issue."
-				fn_scriptlog "No known fix currently. Please log an issue."
-				echo "http://gameservermanagers.com/issues"
-				fn_scriptlog "http://gameservermanagers.com/issues"
-			fi
-		fi
-	fi
-exit 1	
-else
-	fn_printok "${servername}"
-	fn_scriptlog "Started ${servername}"
-fi
-rm "${scriptlogdir}/.${servicename}-tmux-error.tmp"
-echo -en "\n"
-}
-
-if [ "${gamename}" == "Teamspeak 3" ]; then
-	fn_start_teamspeak3
-else
-	fn_start_tmux
-fi

+ 0 - 159
functions/command_stop.sh

@@ -1,159 +0,0 @@
-#!/bin/bash
-# LGSM command_stop.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-# Description: Stops the server.
-
-local modulename="Stopping"
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-sdtd_telnet(){
-    sdtdshutdown=$( expect -c '
-    proc abort {} {
-        puts "Timeout or EOF\n"
-        exit 1
-    }
-    spawn telnet '"${telnetip}"' '"${telnetport}"'
-    expect {
-        "password:"     { send "'"${telnetpass}"'\r" }
-        default         abort
-    }
-    expect {
-        "session."  { send "shutdown\r" }
-        default         abort
-    }
-    expect { eof }
-    puts "Completed.\n"
-    ')
-}
-
-fn_stop_teamspeak3(){
-check.sh
-fn_printdots "${servername}"
-fn_scriptlog "${servername}"
-sleep 1
-info_ts3status.sh
-if [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
-    fn_printfail "${servername} is already stopped"
-    fn_scriptlog "${servername} is already stopped"
-else
-    ${filesdir}/ts3server_startscript.sh stop > /dev/null 2>&1
-    fn_printok "${servername}"
-    fn_scriptlog "Stopped ${servername}"
-fi
-# Remove lock file
-rm -f "${rootdir}/${lockselfname}"
-sleep 1
-echo -en "\n"
-}
-
-fn_stop_tmux(){
-check.sh
-info_config.sh
-fn_printdots "${servername}"
-fn_scriptlog "${servername}"
-sleep 1
-
-if [ "${gamename}" == "7 Days To Die" ] ; then
-    # if game is 7 Days To Die, we need special, graceful shutdown via telnet connection.
-    # Set below variable to be called for expect to operate correctly..
-    fn_printdots "Attempting graceful shutdown via telnet"
-    fn_scriptlog "Attempting graceful shutdown via telnet"
-    sleep 1
-    telnetip=127.0.0.1
-    sdtd_telnet
-
-    # If failed using localhost will use servers ip
-    refused=$(echo -en "\n ${sdtdshutdown}"| grep "Timeout or EOF")
-    if [ -n "${refused}" ]; then
-        telnetip=${ip}
-        fn_printwarn "Attempting graceful shutdown via telnet: localhost failed"
-        fn_scriptlog "Warning! Attempting graceful shutdown failed using localhost"
-        sleep 5
-        echo -en "\n"
-        fn_printdots "Attempting graceful shutdown via telnet: using ${telnetip}"
-        fn_scriptlog "Attempting graceful shutdown via telnet using ${telnetip}"
-        sdtd_telnet
-        sleep 1
-    fi
-
-    refused=$(echo -en "\n ${sdtdshutdown}"| grep "Timeout or EOF")
-    completed=$(echo -en "\n ${sdtdshutdown}"| grep "Completed.")
-    if [ -n "${refused}" ]; then
-        fn_printfail "Attempting graceful shutdown via telnet"
-         fn_scriptlog "Attempting graceful shutdown failed"
-         fn_scriptlog "${refused}"
-    elif [ -n "${completed}" ]; then
-        fn_printok "Attempting graceful shutdown via telnet"
-        fn_scriptlog "Attempting graceful shutdown succeeded"
-    else
-         fn_printfail "Attempting graceful shutdown via telnet: Unknown error"
-         fn_scriptlog "Attempting graceful shutdown failed"
-         fn_scriptlog "Unknown error"
-    fi
-    sleep 1
-    echo -en "\n\n"
-    echo -en "Telnet output:"
-    echo -en "\n ${sdtdshutdown}"
-    echo -en "\n\n"
-    sleep 1
-    fn_printdots "${servername}"
-    fn_scriptlog "${servername}"
-    sleep 5
-    pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:")
-    if [ "${pid}" == "0" ]; then
-        fn_printok "${servername} is already stopped using graceful shutdown"
-        fn_scriptlog "${servername} is already stopped using graceful shutdown"
-    else
-        tmux kill-session -t "${servicename}"
-        fn_printok "${servername}"
-        fn_scriptlog "Stopped ${servername}"
-    fi
-
-else
-    pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:")
-    if [ "${pid}" == "0" ]; then
-        fn_printfail "${servername} is already stopped"
-        fn_scriptlog "${servername} is already stopped"
-    else
-
-        if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
-            sleep 1
-            fn_printdots "Attempting graceful shutdown"
-            fn_scriptlog "Attempting graceful shutdown"
-            tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1
-            counter=0
-            while [ "${pid}" != "0" -a $counter -lt 30 ]; do
-                pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:")
-                sleep 1
-                let counter=counter+1
-                if [  "${counter}" -gt "1" ]; then
-                    fn_printdots "Attempting graceful shutdown: ${counter}"
-                fi    
-            done
-            pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:")
-            if [ "${pid}" == "0" ]; then
-                fn_printok "Attempting graceful shutdown"
-            else
-                fn_printfail "Attempting graceful shutdown"
-            fi
-        fi
-
-        tmux kill-session -t "${servicename}" > /dev/null 2>&1
-        fn_printok "${servername}"
-        fn_scriptlog "Stopped ${servername}"
-    fi
-fi
-    # Remove lock file
-    rm -f "${rootdir}/${lockselfname}"
-    sleep 1
-    echo -en "\n"
-}
-
-if [ "${gamename}" == "Teamspeak 3" ]; then
-    fn_stop_teamspeak3
-else
-    fn_stop_tmux
-fi

+ 0 - 62
functions/command_ts3_server_pass.sh

@@ -1,62 +0,0 @@
-#!/bin/bash
-# LGSM command_serveradmin_password.sh function
-# Author: Daniel Gibbs
-# Contributor : UltimateByte
-# Website: http://gameservermanagers.com
-lgsm_version="080116"
-
-# Description: Changes TS3 serveradmin password
-
-local modulename="Change password"
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-
-fn_serveradmin_password_prompt(){
-echo ""
-echo "${gamename} ServerAdmin Password Change"
-echo "============================"
-echo ""
-echo "Press \"CTRL+b d\" to exit console."
-fn_printinfomationnl "You are about to change the ${gamename} ServerAdmin password."
-fn_printwarningnl "${gamename} will restart during this process."
-echo ""
-while true; do
-	read -e -i "y" -p "Continue? [y/N]" yn
-	case $yn in
-	[Yy]* ) break;;
-	[Nn]* ) echo Exiting; return;;
-	* ) echo "Please answer yes or no.";;
-esac
-done
-fn_scriptlog "Initiating ${gamename} ServerAdmin password change"
-read -p "Enter new password : " newpassword
-}
-
-
-fn_serveradmin_password_set(){
-fn_printinfonl "Applying new password"
-fn_scriptlog "Applying new password"
-sleep 1
-# Stop any running server
-command_stop.sh
-# Start server in "new password mode"
-ts3serverpass="1"
-fn_printinfonl "Starting server with new password"
-command_start.sh
-# Stop server in "new password mode"
-command_stop.sh
-fn_printoknl "Password applied"
-fn_scriptlog "New ServerAdmin password applied"
-sleep 1
-}
-
-# Running functions
-check.sh
-fn_serveradmin_password_prompt
-info_ts3status.sh
-if [ "${ts3status}" == "Server is running" ]; then
-	fn_serveradmin_password_set
-	command_start.sh
-else
-	fn_serveradmin_password_set
-fi

+ 38 - 0
functions/command_update_functions.sh

@@ -0,0 +1,38 @@
+#!/bin/bash
+# LGSM command_update_functions.sh function
+# Author: Daniel Gibbs
+# Website: https://gameservermanagers.com
+lgsm_version="210516"
+
+# Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
+
+function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+check.sh
+fn_print_dots "Updating functions"
+fn_scriptlog "Updating functions"
+sleep 1
+echo -ne "\n"
+
+# Removed legecy functions dir
+if [ -n "${rootdir}" ]; then
+	if [ -d "${rootdir}/functions/" ]; then
+		rm -rfv "${rootdir}/functions/"
+		exitcode=$?
+	fi
+fi
+
+if [ -n "${functionsdir}" ]; then
+	if [ -d "${functionsdir}" ]; then
+		rm -rfv "${functionsdir}/"*
+		exitcode=$?
+	fi
+fi
+
+if [ "${exitcode}" == "0" ]; then
+	fn_print_ok "Updating functions"
+	fn_scriptlog "Success! Updating functions"
+else
+	fn_print_fail "Updating functions"
+	fn_scriptlog "Failure! Updating functions"
+fi
+echo -ne "\n"

+ 0 - 49
functions/command_validate.sh

@@ -1,49 +0,0 @@
-#!/bin/bash
-# LGSM command_validate.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-# Description: Runs a server validation.
-
-local modulename="Validate"
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-fn_validation(){
-fn_printwarn "Validating may overwrite some customised files."
-sleep 1
-echo -en "\n"
-echo -en "https://developer.valvesoftware.com/wiki/SteamCMD#Validate"
-sleep 5
-echo -en "\n"
-fn_printdots "Checking server files"
-sleep 1
-fn_printok "Checking server files"
-fn_scriptlog "Checking server files"
-sleep 1
-
-cd "${rootdir}/steamcmd"
-
-if [ $(command -v unbuffer) ]; then
-	unbuffer=unbuffer
-fi
-
-if [ "${engine}" == "goldsource" ]; then
-	${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}"
-else
-	${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}"
-fi
-
-fix.sh
-fn_scriptlog "Checking complete"
-}
-
-check.sh
-tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
-if [ "${tmuxwc}" -eq 1 ]; then
-    command_stop.sh
-    fn_validation
-    command_start.sh
-else
-    fn_validation
-fi

+ 69 - 399
functions/core_functions.sh

@@ -1,402 +1,72 @@
 #!/bin/bash
 # LGSM core_functions.sh function
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="170116"
-
-# Description: Defines all functions to allow download and execution of functions using fn_runfunction.
-# This function is called first before any other function. Without this file other functions would not load.
-
-#Legacy functions
-
-fn_functions(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_getopt(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-# Core
-
-core_getopt.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-core_messages.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-# Command
-
-command_console.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_debug.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_details.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_email_test.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_backup.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_monitor.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_start.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_stop.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_validate.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_install.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_ts3_server_pass.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fn_restart(){
-local modulename="Restarting"
-info_config.sh
-fn_scriptlog "${servername}"
-command_stop.sh
-command_start.sh
-}
-
-
-# Checks
-
-check.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-check_config.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-check_deps.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-check_ip.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-check_logs.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-check_root.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-check_steamcmd.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-check_steamuser.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-check_systemdir.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-check_tmux.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-# Compress
-
-compress_unreal2_maps.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-compress_ut99_maps.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-# Dev
-
-command_dev_debug.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-command_dev_detect_deps.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-# Fix
-
-fix.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fix_arma3.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fix_csgo.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fix_dst.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fix_ins.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fix_steamcmd.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fix_glibc.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fix_ro.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fix_kf.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fix_ut2k4.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-# Info
-
-info_config.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-info_distro.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-info_glibc.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-info_ts3status.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-# Email
-
-email.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-# Logs
-
-logs.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-# Monitor
-
-monitor_gsquery.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-# Update
-
-update_check.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-update_functions.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-update_dl.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-update_functions.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-
-#
-## Installer functions
-#
-
-fn_autoinstall(){
-autoinstall=1
-command_install.sh
-}
-
-install_complete.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_config.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_gsquery.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_gslt.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_header.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_logs.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_retry.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_serverdir.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-install_serverfiles.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_steamcmd.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_ts3.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_ts3db.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_ut2k4.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_dl_ut2k4.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_ut2k4_key.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_ut99.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-install_dl_ut99.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-fix_ut99.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
-# Calls on-screen messages
-core_messages.sh
+# Website: https://gameservermanagers.com
+lgsm_version="210516"
+
+# Description: REDIRECT FUNCTION to new location for core_functions.sh
+
+# fn_fetch_core_dl also placed here to allow legecy servers to still download core functions
+if [ -z "${lgsmdir}" ]; then
+	lgsmdir="${rootdir}/lgsm"
+	functionsdir="${lgsmdir}/functions"
+	libdir="${lgsmdir}/lib"
+fi
+
+fn_fetch_core_dl(){
+if [ -z "${githubuser}" ]; then
+	githubuser="dgibbs64"
+fi
+if [ -z "${githubrepo}" ]; then
+	githubrepo="linuxgsm"
+fi
+if [ -z "${githubbranch}" ]; then
+	githubbranch="master"
+fi
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
+	if [ ! -d "${filedir}" ]; then
+		mkdir -p "${filedir}"
+	fi
+	echo -e "    fetching ${filename}...\c"
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
+		echo -e "\e[0;31mFAIL\e[0m\n"
+		echo "Curl is not installed!"
+		echo -e ""
+		exit 1
+	fi
+	chmod +x "${filedir}/${filename}"
+fi
+source "${filedir}/${filename}"
+}
+
+core_functions.sh(){
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
+}
+
+core_functions.sh

+ 7 - 420
functions/core_getopt.sh

@@ -1,427 +1,14 @@
 #!/bin/bash
 # LGSM core_getopt.sh function
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="070116"
+# Website: https://gameservermanagers.com
+lgsm_version="210516"
 
-# Description: getopt arguments.
+# Description: REDIRECT FUNCTION to new location for core_getopt.sh
 
-fn_getopt_generic(){
-case "$getopt" in
-	st|start)
-		command_start.sh;;
-	sp|stop)
-		command_stop.sh;;
-	r|restart)
-		fn_restart;;
-	u|update)
-		update_check.sh;;
-	fu|force-update|update-restart)
-		forceupdate=1;
-		update_check.sh;;
-	uf|update-functions)
-		update_functions.sh;;
-	v|validate)
-		command_validate.sh;;
-	m|monitor)
-		command_monitor.sh;;
-	et|email-test)
-		command_email_test.sh;;
-	d|details)
-		command_details.sh;;
-	b|backup)
-		command_backup.sh;;
-	c|console)
-		command_console.sh;;
-	d|debug)
-		command_debug.sh;;
-	dev|dev-debug)
-		command_dev_debug.sh;;
-	i|install)
-		command_install.sh;;
-	ai|auto-install)
-		fn_autoinstall;;
-	dd|depsdetect)
-		command_dev_detect_deps.sh;;
-	*)
-	echo "Usage: $0 [option]"
-	echo "${gamename} - Linux Game Server Manager - Version ${version}"
-	echo "http://gameservermanagers.com/${selfname}"
-	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
-	{
-		echo -e "\e[34mstart\t\e[0mStart the server."
-		echo -e "\e[34mstop\t\e[0mStop the server."
-		echo -e "\e[34mrestart\t\e[0mRestart the server."
-		echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD."
-		echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD."
-		echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded."
-		echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD."
-		echo -e "\e[34mmonitor\t\e[0mChecks that the server is running."
-		echo -e "\e[34memail-test\t\e[0mSends test monitor email."		
-		echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server."
-		echo -e "\e[34mbackup\t\e[0mCreate archive of the server."
-		echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal."
-		echo -e "\e[34minstall\t\e[0mInstall the server."
-		echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts."
-	} | column -s $'\t' -t 
-	esac
-exit
+core_getopt.sh(){
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
 }
 
-fn_getopt_teamspeak3(){
-case "$getopt" in
-	st|start)
-		command_start.sh;;
-	sp|stop)
-		command_stop.sh;;
-	r|restart)
-		fn_restart;;
-	u|update)
-		update_check.sh;;
-	uf|update-functions)
-		update_functions.sh;;
-	m|monitor)
-		command_monitor.sh;;
-	et|email-test)
-		command_email_test.sh;;
-	d|details)
-		command_details.sh;;
-	b|backup)
-		command_backup.sh;;
-	pw|change-password)
-		command_ts3_server_pass.sh;;
-	dev|dev-debug)
-		command_dev_debug.sh;;		
-	i|install)
-		command_install.sh;;
-	ai|auto-install)
-		fn_autoinstall;;
-	dd|depsdetect)
-		command_dev_detect_deps.sh;;
-	*)
-	echo "Usage: $0 [option]"
-	echo "${gamename} - Linux Game Server Manager - Version ${version}"
-	echo "http://gameservermanagers.com/${selfname}"
-	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
-	{
-		echo -e "\e[34mstart\t\e[0mStart the server."
-		echo -e "\e[34mstop\t\e[0mStop the server."
-		echo -e "\e[34mrestart\t\e[0mRestart the server."
-		echo -e "\e[34mupdate\t\e[0mChecks and applies updates from teamspeak.com."
-		echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded."
-		echo -e "\e[34mmonitor\t\e[0mChecks that the server is running."
-		echo -e "\e[34memail-test\t\e[0mSends test monitor email."
-		echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server."
-		echo -e "\e[34mchange-password\t\e[0mChanges TS3 serveradmin password."
-		echo -e "\e[34mbackup\t\e[0mCreate archive of the server."
-		echo -e "\e[34minstall\t\e[0mInstall the server."
-		echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts."
-	} | column -s $'\t' -t 
-	esac
-exit
-}
-
-fn_getopt_mumble(){
-case "$getopt" in
-	st|start)
-		command_start.sh;;
-	sp|stop)
-		command_stop.sh;;
-	r|restart)
-		fn_restart;;
-	uf|update-functions)
-		update_functions.sh;;
-	m|monitor)
-		command_monitor.sh;;
-	et|email-test)
-		command_email_test.sh;;
-	b|backup)
-		command_backup.sh;;
-	dev|dev-debug)
-		command_dev_debug.sh;;		
-	console)
-		command_console.sh;;
-	d|debug)
-		command_debug.sh;;
-	dd|depsdetect)
-		command_dev_detect_deps.sh;;
-	*)
-	echo "Usage: $0 [option]"
-	echo "${gamename} - Linux Game Server Manager - Version ${version}"
-	echo "http://gameservermanagers.com/${selfname}"
-	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
-	{
-		echo -e "\e[34mstart\t\e[0mStart the server."
-		echo -e "\e[34mstop\t\e[0mStop the server."
-		echo -e "\e[34mrestart\t\e[0mRestart the server."
-		echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded."
-		echo -e "\e[34mmonitor\t\e[0mChecks that the server is running."
-		echo -e "\e[34memail-test\t\e[0mSends test monitor email."
-		echo -e "\e[34mbackup\t\e[0mCreate archive of the server."
-		echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server."		
-		echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal."
-	} | column -s $'\t' -t 
-	esac
-exit
-}
-
-fn_getopt_gmodserver(){
-case "$getopt" in
-	st|start)
-		command_start.sh;;
-	sp|stop)
-		command_stop.sh;;
-	r|restart)
-		fn_restart;;
-	u|update)
-		update_check.sh;;
-	fu|force-update|update-restart)
-		forceupdate=1;
-		update_check.sh;;
-	uf|update-functions)
-		update_functions.sh;;
-	v|validate)
-		command_validate.sh;;
-	m|monitor)
-		command_monitor.sh;;
-	et|email-test)
-		command_email_test.sh;;
-	d|details)
-		command_details.sh;;
-	b|backup)
-		command_backup.sh;;
-	c|console)
-		command_console.sh;;
-	d|debug)
-		command_debug.sh;;
-	dev|dev-debug)
-		command_dev_debug.sh;;		
-	i|install)
-		command_install.sh;;
-	ai|auto-install)
-		fn_autoinstall;;
-	dd|depsdetect)
-		command_dev_detect_deps.sh;;
-	*)
-	echo "Usage: $0 [option]"
-	echo "${gamename} - Linux Game Server Manager - Version ${version}"
-	echo "http://gameservermanagers.com/${selfname}"
-	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
-	{
-		echo -e "\e[34mstart\t\e[0mStart the server."
-		echo -e "\e[34mstop\t\e[0mStop the server."
-		echo -e "\e[34mrestart\t\e[0mRestart the server."
-		echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD."
-		echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD."
-		echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded."
-		echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD."
-		echo -e "\e[34mmonitor\t\e[0mChecks that the server is running."
-		echo -e "\e[34memail-test\t\e[0mSends test monitor email."
-		echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server."
-		echo -e "\e[34mbackup\t\e[0mCreate archive of the server."
-		echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal."
-		echo -e "\e[34minstall\t\e[0mInstall the server."
-		echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts."
-	} | column -s $'\t' -t 
-	esac
-exit
-}
-
-fn_getopt_unreal(){
-case "$getopt" in
-	st|start)
-		command_start.sh;;
-	sp|stop)
-		command_stop.sh;;
-	r|restart)
-		fn_restart;;
-	uf|update-functions)
-		update_functions.sh;;
-	m|monitor)
-		command_monitor.sh;;
-	et|email-test)
-		command_email_test.sh;;
-	d|details)
-		command_details.sh;;
-	b|backup)
-		command_backup.sh;;
-	c|console)
-		command_console.sh;;
-	d|debug)
-		command_debug.sh;;
-	dev|dev-debug)
-		command_dev_debug.sh;;		
-	i|install)
-		command_install.sh;;
-	mc|map-compressor)
-		compress_ut99_maps.sh;;
-	dd|depsdetect)
-		command_dev_detect_deps.sh;;		
-	*)
-	echo "Usage: $0 [option]"
-	echo "${gamename} - Linux Game Server Manager - Version ${version}"
-	echo "http://gameservermanagers.com/${selfname}"
-	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
-	{
-		echo -e "\e[34mstart\t\e[0mStart the server."
-		echo -e "\e[34mstop\t\e[0mStop the server."
-		echo -e "\e[34mrestart\t\e[0mRestart the server."
-		echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded."
-		echo -e "\e[34mmonitor\t\e[0mChecks that the server is running."
-		echo -e "\e[34memail-test\t\e[0mSends test monitor email."
-		echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server."
-		echo -e "\e[34mbackup\t\e[0mCreate archive of the server."
-		echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal."
-		echo -e "\e[34minstall\t\e[0mInstall the server."
-		echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps."
-	} | column -s $'\t' -t 
-	esac
-exit
-}
-
-
-fn_getopt_unreal2(){
-case "$getopt" in
-	st|start)
-		command_start.sh;;
-	sp|stop)
-		command_stop.sh;;
-	r|restart)
-		fn_restart;;
-	u|update)
-		update_check.sh;;
-	fu|force-update|update-restart)
-		forceupdate=1;
-		update_check.sh;;
-	uf|update-functions)
-		update_functions.sh;;
-	v|validate)
-		command_validate.sh;;
-	m|monitor)
-		command_monitor.sh;;
-	et|email-test)
-		command_email_test.sh;;
-	d|details)
-		command_details.sh;;
-	b|backup)
-		command_backup.sh;;
-	c|console)
-		command_console.sh;;
-	d|debug)
-		command_debug.sh;;
-	dev|dev-debug)
-		command_dev_debug.sh;;		
-	i|install)
-		command_install.sh;;
-	ai|auto-install)
-		fn_autoinstall;;
-	dd|depsdetect)
-		command_dev_detect_deps.sh;;
-	mc|map-compressor)
-		compress_unreal2_maps.sh;;
-	*)
-	echo "Usage: $0 [option]"
-	echo "${gamename} - Linux Game Server Manager - Version ${version}"
-	echo "http://gameservermanagers.com/${selfname}"
-	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
-	{
-		echo -e "\e[34mstart\t\e[0mStart the server."
-		echo -e "\e[34mstop\t\e[0mStop the server."
-		echo -e "\e[34mrestart\t\e[0mRestart the server."
-		echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD."
-		echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD."
-		echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded."
-		echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD."
-		echo -e "\e[34mmonitor\t\e[0mChecks that the server is running."
-		echo -e "\e[34memail-test\t\e[0mSends test monitor email."		
-		echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server."
-		echo -e "\e[34mbackup\t\e[0mCreate archive of the server."
-		echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal."
-		echo -e "\e[34minstall\t\e[0mInstall the server."
-		echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts."
-		echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps."		
-	} | column -s $'\t' -t 
-	esac
-exit
-}
-
-
-fn_getopt_ut2k4(){
-case "$getopt" in
-	st|start)
-		command_start.sh;;
-	sp|stop)
-		command_stop.sh;;
-	r|restart)
-		fn_restart;;
-	uf|update-functions)
-		update_functions.sh;;
-	m|monitor)
-		command_monitor.sh;;
-	et|email-test)
-		command_email_test.sh;;
-	d|details)
-		command_details.sh;;
-	b|backup)
-		command_backup.sh;;
-	c|console)
-		command_console.sh;;
-	d|debug)
-		command_debug.sh;;
-	dev|dev-debug)
-		command_dev_debug.sh;;		
-	i|install)
-		command_install.sh;;
-	mc|map-compressor)
-		compress_unreal2_maps.sh;;
-	dd|depsdetect)
-		command_dev_detect_deps.sh;;		
-	*)
-	echo "Usage: $0 [option]"
-	echo "${gamename} - Linux Game Server Manager - Version ${version}"
-	echo "http://gameservermanagers.com/${selfname}"
-	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
-	{
-		echo -e "\e[34mstart\t\e[0mStart the server."
-		echo -e "\e[34mstop\t\e[0mStop the server."
-		echo -e "\e[34mrestart\t\e[0mRestart the server."
-		echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded."
-		echo -e "\e[34mmonitor\t\e[0mChecks that the server is running."
-		echo -e "\e[34memail-test\t\e[0mSends test monitor email."
-		echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server."
-		echo -e "\e[34mbackup\t\e[0mCreate archive of the server."
-		echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal."
-		echo -e "\e[34minstall\t\e[0mInstall the server."
-		echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps."
-	} | column -s $'\t' -t 
-	esac
-exit
-}
-
-if [ "${gamename}" == "Mumble" ]; then
-	fn_getopt_mumble
-elif [ "${gamename}" == "Teamspeak 3" ]; then
-	fn_getopt_teamspeak3
-elif [ "${engine}" == "unreal2" ]; then
-	if [ "${gamename}" == "Unreal Tournament 2004" ]; then
-		fn_getopt_ut2k4
-	else
-		fn_getopt_unreal2
-	fi
-elif [ "${engine}" == "unreal" ]; then
-	fn_getopt_unreal
-else
-	fn_getopt_generic
-fi
+core_getopt.sh

+ 0 - 148
functions/core_messages.sh

@@ -1,148 +0,0 @@
-#!/bin/bash
-# LGSM fn_messages function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-# Description: Defines on-screen messages such as [  OK  ] and how script logs look.
-
-# Date and servicename for log files.
-fn_scriptlog(){
-	if [ -n "${modulename}" ]; then
-		echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${modulename}: ${1}" >> "${scriptlog}"
-	else
-		echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
-	fi
-}
-
-# [ FAIL ]
-fn_printfail(){
-	if [ -n "${modulename}" ]; then
-		echo -en "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@"
-	else
-		echo -en "\r\033[K[\e[0;31m FAIL \e[0m] $@"
-	fi
-}
-
-fn_printfailnl(){
-	if [ -n "${modulename}" ]; then
-		echo -e "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@"
-	else
-		echo -e "\r\033[K[\e[0;31m FAIL \e[0m] $@"
-	fi
-}
-	
-# [  OK  ]
-fn_printok(){
-	if [ -n "${modulename}" ]; then
-		echo -en "\r\033[K[\e[0;32m  OK  \e[0m] ${modulename} ${servicename}: $@"
-	else
-		echo -en "\r\033[K[\e[0;32m  OK  \e[0m] $@"
-	fi
-}
-
-fn_printoknl(){
-	if [ -n "${modulename}" ]; then
-		echo -e "\r\033[K[\e[0;32m  OK  \e[0m] ${modulename} ${servicename}: $@"
-	else
-		echo -e "\r\033[K[\e[0;32m  OK  \e[0m] $@"
-	fi
-}
-
-# [ INFO ]
-fn_printinfo(){
-	if [ -n "${modulename}" ]; then
-		echo -en "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@"
-	else
-		echo -en "\r\033[K[\e[0;36m INFO \e[0m] $@"
-	fi
-}
-
-fn_printinfonl(){
-	if [ -n "${modulename}" ]; then
-		echo -e "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@"
-	else
-		echo -e "\r\033[K[\e[0;36m INFO \e[0m] $@"
-	fi
-}
-
-# [ WARN ]
-fn_printwarn(){
-	if [ -n "${modulename}" ]; then
-		echo -en "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@"
-	else
-		echo -en "\r\033[K[\e[1;33m WARN \e[0m] $@"
-	fi
-}
-
-fn_printwarnnl(){
-	if [ -n "${modulename}" ]; then
-		echo -e "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@"
-	else
-		echo -e "\r\033[K[\e[1;33m WARN \e[0m] $@"
-	fi
-}
-
-# [ .... ]
-fn_printdots(){
-	if [ -n "${modulename}" ]; then
-		echo -en "\r\033[K[ .... ] ${modulename} ${servicename}: $@"
-	else
-		echo -en "\r\033[K[ .... ] $@"
-	fi
-}
-
-# Complete!
-fn_printcomplete(){
-	echo -en "\e[0;32mComplete!\e[0m $@"
-}
-
-fn_printcompletenl(){
-	echo -e "\e[0;32mComplete!\e[0m $@"
-}
-
-# Warning!
-fn_printwarning(){
-	echo -en "\e[0;33mWarning!\e[0m $@"
-}
-
-fn_printwarningnl(){
-	echo -e "\e[0;33mWarning!\e[0m $@"
-}
-
-# Failure!
-fn_printfailure(){
-	echo -en "\e[0;31mFailure!\e[0m $@"
-}
-
-fn_printfailurenl(){
-	echo -e "\e[0;31mFailure!\e[0m $@"
-}
-
-# Error!
-fn_printerror(){
-	echo -en "\e[0;31mError!\e[0m $@"
-}
-
-fn_printerrornl(){
-	echo -e "\e[0;31mError!\e[0m $@"
-}
-
-# Info!
-fn_printinfomation(){
-	echo -en "\e[0;36mInfo!\e[0m $@"
-}
-
-fn_printinfomationnl(){
-	echo -e "\e[0;36mInfo!\e[0m $@"
-}
-
-# FAIL for end of line
-fn_printokeol(){
-	echo -e "\e[0;32mOK\e[0m"
-}
-
-# FAIL for end of line
-fn_printfaileol(){
-	echo -e "\e[0;31mFAIL\e[0m\n"
-}

+ 0 - 70
functions/email.sh

@@ -1,70 +0,0 @@
-#!/bin/bash
-# LGSM email.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="020216"
-
-# Description: Sends email notification if monitor picks up a failure.
-
-local modulename="Email"
-fn_printdots "Sending notification to ${email}"
-info_distro.sh
-info_config.sh
-check_ip.sh
-fn_parms
-{
-	echo -e "========================================\n${servicename} details\n========================================"
-	echo -e "Service name: ${servicename}"
-	echo -e "Server name: ${servername}"
-	echo -e "Game name: ${gamename}"
-	echo -e "Server IP: ${ip}:${port}"
-	echo -e "Failure reason: ${failurereason}"
-	echo -e "Action Taken: ${actiontaken}\n"
-	echo -e ""
-	echo -e "========================================\nDistro Details\n========================================"
-	echo -e "Date: $(date)"
-	echo -e "Distro: ${os}"
-	echo -e "Arch: ${arch}"
-	echo -e "Kernel: ${kernel}"
-	echo -e "Hostname: $HOSTNAME"
-	echo -e "tmux: ${tmuxv}"
-	echo -e "GLIBC: ${glibcv}"
-	echo -e ""
-	echo -e "========================================\nPerformance\n========================================"
-	echo -e "Uptime: ${days}d, ${hours}h, ${minutes}m"
-	echo -e "Avg Load: ${load}" 
-	echo -e ""
-	echo -e "Mem: total used free"
-	echo -e "Physical: ${physmemtotal} ${physmemused} ${physmemfree}"
-	echo -e "Swap: ${swaptotal}${swapused} ${swapfree}"
-	echo -e ""
-	echo -e "========================================\nStorage\n========================================"	
-	echo -e "\e[34mFilesystem:\t\e[0m${filesystem}"
-	echo -e "\e[34mTotal:\t\e[0m${totalspace}"
-	echo -e "\e[34mUsed:\t\e[0m${usedspace}"
-	echo -e "\e[34mAvailable:\t\e[0m${availspace}"
-	echo -e "\e[34mServerfiles:\t\e[0m${filesdirdu}"
-	if [ -d "${backupdir}" ]; then
-		echo -e "\e[34mBackups:\t\e[0m${backupdirdu}"
-	fi
-	echo -e ""	
-	echo -e "========================================\nCommand-line Parameters\n========================================"
-	echo -e "${executable} ${parms}"
-	echo -e ""
-	echo -e "========================================\nLogs\n========================================"
-}| sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee "${scriptlogdir}/${servicename}-email.log" > /dev/null 2>&1
-echo -e "\n\n	Script log\n===================" >> "${emaillog}"
-tail -25 "${scriptlog}" >> "${emaillog}"
-if [ ! -z "${consolelog}" ]; then
-	echo -e "\n\n	Console log\n====================" >> "${emaillog}"
-	tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }' >> "${emaillog}"
-fi
-if [ ! -z "${gamelogdir}" ]; then
-	echo -e "\n\n	Server log\n====================" >> "${emaillog}"
-	tail "${gamelogdir}"/* | grep -v "==>" | sed '/^$/d' | tail -25 >> "${emaillog}"
-fi
-mail -s "${subject}" ${email} < "${emaillog}"
-fn_printok "Sending notification to ${email}"
-fn_scriptlog "Sent notification to ${email}"
-sleep 1
-echo -en "\n"

+ 0 - 33
functions/fix_arma3.sh

@@ -1,33 +0,0 @@
-#!/bin/bash
-# LGSM fix_arma3.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="301215"
-
-# Fixes line 63: 20150 Segmentation fault (core dumped) #488
-
-fn_msg_start(){
-	fn_printdots "Applying ${fixname} fix: ${gamename}"
-	sleep 1
-	fn_printinfo "Applying ${fixname} fix: ${gamename}"
-	fn_scriptlog "Applying ${fixname} fix: ${gamename}"
-	sleep 1
-}
-
-fn_msg_end(){
-	if [ $? -ne 0 ]; then
-		fn_printfailnl "Applying ${fixname} fix: ${gamename}"
-		fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}"
-	else
-		fn_printoknl "Applying ${fixname} fix: ${gamename}"
-		fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}"
-	fi	
-}
-
-# Fixes: server not always creating steam_appid.txt file.
-if [ ! -d "${rootdir}/.local/share/Arma\ 3" ]; then
-	local fixname="20150 Segmentation fault (core dumped)"
-	fn_msg_start
-	mkdir -p "${rootdir}/.local/share/Arma\ 3"
-	fn_msg_end
-fi

+ 0 - 34
functions/fix_dst.sh

@@ -1,34 +0,0 @@
-#!/bin/bash
-# LGSM fix_dst.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="020116"
-
-# Fixes line 63: 20150 Segmentation fault (core dumped) #488
-
-fn_msg_start(){
-	fn_printdots "Applying ${fixname} fix: ${gamename}"
-	sleep 1
-	fn_printinfo "Applying ${fixname} fix: ${gamename}"
-	fn_scriptlog "Applying ${fixname} fix: ${gamename}"
-	sleep 1
-}
-
-fn_msg_end(){
-	if [ $? -ne 0 ]; then
-		fn_printfailnl "Applying ${fixname} fix: ${gamename}"
-		fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}"
-	else
-		fn_printoknl "Applying ${fixname} fix: ${gamename}"
-		fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}"
-	fi	
-}
-
-# Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer)
-# Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS.
-if [ -f "/etc/redhat-release" ] && [ ! -f "${filesdir}/bin/lib32/libcurl-gnutls.so.4" ]; then
-	local fixname="libcurl-gnutls.so.4 missing"
-	fn_msg_start
-	ln -s "/usr/lib/libcurl.so.4" "${filesdir}/bin/lib32/libcurl-gnutls.so.4"
-	fn_msg_end
-fi

+ 0 - 144
functions/fix_glibc.sh

@@ -1,144 +0,0 @@
-#!/bin/bash
-# LGSM fix_glibc.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="020116"
-
-fn_glibcfixmsg(){
-echo ""
-echo "GLIBC Fix required"
-echo "============================"
-sleep 1
-fn_printwarningnl "${gamename} requires GLIBC_${glibcversion} or above"
-sleep 1
-echo ""
-echo -e "Currently installed:\e[0;31m GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')\e[0;39m"
-echo -e "Required: =>\e[0;32m GLIBC_${glibcversion}\e[0;39m"
-echo ""
-sleep 1
-echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with less than GLIBC_${glibcversion}."
-echo "note: This will NOT upgrade GLIBC on your system."
-echo ""
-echo "http://gameservermanagers.com/glibcfix"
-sleep 1
-echo ""
-echo -en "loading required files.\r"
-sleep 1
-echo -en "loading required files..\r"
-sleep 1
-echo -en "loading required files...\r"
-sleep 1
-echo -en "\n"
-}
-
-# if ldd command not detected
-if [ -z $(command -v ldd) ]; then
-	echo ""
-	fn_printfailurenl "GLIBC is not detected"
-	sleep 1
-	echo "Install GLIBC and retry installation."
-	sleep 1
-	echo ""
-	while true; do
-		read -e -i "y" -p "Continue install? [Y/n]" yn
-		case $yn in
-			[Yy]* ) break;;
-			[Nn]* ) echo Exiting; exit;;
-			 * ) echo "Please answer yes or no.";;
-		esac
-	done
-# if Glibc less than 1.15
-elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 215 ]; then
-	# Blade Symphony
-	if [ "${gamename}" == "Blade Symphony" ]; then
-		glibcversion="2.15"
-		fn_glibcfixmsg
-		cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
-	# Dont Starve Together
-	elif [ "${gamename}" == "Don't Starve Together" ]; then
-		glibcversion="2.15"
-		fn_glibcfixmsg
-		cd "${filesdir}/bin/lib32/"
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/DontStarveTogether/dependencies/libc.so.6
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/DontStarveTogether/dependencies/libpthread.so.0
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/DontStarveTogether/dependencies/librt.so.1
-	# Double Action: Boogaloo
-	elif [ "${gamename}" == "Double Action: Boogaloo" ]; then
-		glibcversion="2.15"
-		fn_glibcfixmsg
-		cd "${filesdir}"
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/blob/master/DoubleActionBoogaloo/dependencies/libm.so.6
-	# Fistful of Frags
-	elif [ "${gamename}" == "Fistful of Frags" ]; then
-		glibcversion="2.15"
-		fn_glibcfixmsg
-		cd "${filesdir}"
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/FistfulOfFrags/dependencies/libm.so.6
-	# Garry's Mod
-	elif [ "${gamename}" == "Garry's Mod" ]; then
-		glibcversion="2.15"
-		fn_glibcfixmsg
-		cd "${filesdir}/bin"
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libc.so.6
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libm.so.6
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libpthread.so.0
-		cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
-	# Insurgency
-	elif [ "${gamename}" == "Insurgency" ]; then
-		glibcversion="2.15"
-		fn_glibcfixmsg
-		cd "${filesdir}/bin"
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libc.so.6
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libm.so.6
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/librt.so.1
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libpthread.so.0
-	elif [ "${gamename}" == "Left 4 Dead" ]; then
-		glibcversion="2.07"
-		fn_glibcfixmsg
-		cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/bin/libstdc++.so.6"
-	# Natural Selection 2
-	elif [ "${gamename}" == "Natural Selection 2" ]; then
-		glibcversion="2.15"
-		fn_glibcfixmsg
-		cd "${filesdir}"
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NaturalSelection2/dependencies/libm.so.6
-		cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
-		# NS2: Combat
-		elif [ "${gamename}" == "NS2: Combat" ]; then
-			glibcversion="2.15"
-			fn_glibcfixmsg
-			cd "${filesdir}"
-			wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NS2Combat/dependencies/libm.so.6
-			cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
-	# No More Room in Hell
-	elif [ "${gamename}" == "No More Room in Hell" ]; then
-		glibcversion="2.15"
-		fn_glibcfixmsg
-		cd "${filesdir}"
-		wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NoMoreRoomInHell/dependencies/libm.so.6
-		cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
-	# if Glibc less than 1.13
-	elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 213 ]; then
-		# ARMA 3
-		if [ "${gamename}" == "ARMA 3" ]; then
-			glibcversion="2.13"
-			fn_glibcfixmsg
-			cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
-		# Just Cause 2
-		elif [ "${gamename}" == "Just Cause 2" ]; then
-			glibcversion="2.13"
-			fn_glibcfixmsg
-			cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6"
-		# Serious Sam 3: BFE
-		elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
-			glibcversion="2.13"
-			fn_glibcfixmsg
-			cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/Bin/libstdc++.so.6"
-		else
-			: # Else glibcfix not required.
-		fi
-	else
-		: #Else glibcfix not required.
-	fi
-fi
-sleep 1

+ 4 - 9
functions/fn_functions

@@ -1,10 +1,10 @@
 #!/bin/bash
-# LGSM core_functions.sh function
+# LGSM fn_functions function
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
+# Website: https://gameservermanagers.com
+lgsm_version="210516"
 
-# Description: Redirect to new core_functions.sh
+# Description: REDIRECT FUNCTION to new core_functions.sh
 
 core_functions.sh(){
 # Functions are defined in core_functions.sh.
@@ -12,9 +12,4 @@ functionfile="${FUNCNAME}"
 fn_runfunction
 }
 
-core_getopt.sh(){
-functionfile="${FUNCNAME}"
-fn_runfunction
-}
-
 core_functions.sh

+ 5 - 6
functions/fn_getopt

@@ -1,15 +1,14 @@
 #!/bin/bash
-# LGSM core_getopt.sh function
+# LGSM fn_getopt.sh function
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
+# Website: https://gameservermanagers.com
+lgsm_version="210516"
 
-# Description: Redirect to new core_getopt.sh
+# Description: REDIRECT FUNCTION to new core_getopt.sh
 
 core_getopt.sh(){
-# Functions are defined in core_functions.sh.
 functionfile="${FUNCNAME}"
-fn_runfunction
+fn_fetch_core_dl
 }
 
 core_getopt.sh

+ 11 - 18
functions/fn_update_functions

@@ -1,22 +1,15 @@
 #!/bin/bash
-# LGSM update_functions.sh function
+# LGSM fn_update_functions function
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="230116"
+# Website: https://gameservermanagers.com
+lgsm_version="210516"
 
-# Description: LEGACY FUNCTION Deletes the functions dir to allow re-downloading of functions from GitHub.
+# Description: REDIRECT FUNCTION to new command_update_functions.sh
+
+command_update_functions.sh(){
+functionfile="${FUNCNAME}"
+fn_runfunction
+}
+
+command_update_functions.sh
 
-fn_printdots "Updating functions"
-fn_scriptlog "Updating functions"
-sleep 1
-echo -ne "\n"
-rm -rfv "${rootdir}/functions/"*
-exitcode=$?
-if [ "${exitcode}" == "0" ]; then
-	fn_printok "Updating functions"
-	fn_scriptlog "Success! Updating functions"
-else
-	fn_printfail "Updating functions"
-	fn_scriptlog "Failure! Updating functions"
-fi
-echo -ne "\n"

+ 0 - 807
functions/info_config.sh

@@ -1,807 +0,0 @@
-#!/bin/bash
-# LGSM info_config.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="060116"
-
-# Description: Gets specific details from config files.
-
-## Examples of filtering to get info from config files
-# sed 's/foo//g' - remove foo
-# tr -cd '[:digit:]' leave only digits
-# tr -d '=\"; ' remove selected charectors =\";
-# grep -v "foo" filter out lines that contain foo
-
-## Just Cause 2
-if [ "${engine}" == "avalanche" ]; then
-
-	# server name
-	if [ -f "${servercfgfullpath}" ]; then
-		servername=$(grep "Name" "${servercfgfullpath}" | sed 's/Name//g' | tr -d '=", \n')
-		if [ ! -n "${servername}" ]; then
-			servername="NOT SET"
-		fi
-	else
-		servername="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# ip
-	if [ -f "${servercfgfullpath}" ]; then
-		# check if the ip exists in the config file. Failing this will fall back to the default.
-		configipcheck=$(grep "BindIP" "${servercfgfullpath}" | sed 's/BindIP//g' | tr -d '=", \n')
-	fi
-	if [ -n "${configipcheck}" ]; then
-		ip=$(grep "BindIP" "${servercfgfullpath}" | sed 's/BindIP//g' | tr -d '=", \n')
-	fi
-
-	# server password
-	if [ -f "${servercfgfullpath}" ]; then
-		serverpassword=$(grep "Password" "${servercfgfullpath}" | sed 's/Password//g' | tr -d '=", \n')
-		if [ ! -n "${serverpassword}" ]; then
-			serverpassword="NOT SET"
-		fi
-	else
-		serverpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# slots
-	if [ -f "${servercfgfullpath}" ]; then
-		slots=$(grep "MaxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]')
-		if [ ! -n "${slots}" ]; then
-			slots="NOT SET"
-		fi
-	else
-		slots="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "BindPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${port}" ]; then
-		port="0"
-	fi
-
-## Dont Starve Together
-elif [ "${engine}" == "dontstarve" ]; then
-
-	# server name
-	if [ -f "${servercfgfullpath}" ]; then
-		servername=$(grep "default_server_name = " "${servercfgfullpath}" | sed 's/default_server_name = //g')
-		if [ ! -n "${servername}" ]; then
-			servername="NOT SET"
-		fi
-	else
-		servername="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# server password
-	if [ -f "${servercfgfullpath}" ]; then
-		serverpassword=$(grep "server_password = " "${servercfgfullpath}" | grep -v "#" | sed 's/server_password = //g')
-		if [ ! -n "${serverpassword}" ]; then
-			serverpassword="NOT SET"
-		fi
-	else
-		serverpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# slots
-	if [ -f "${servercfgfullpath}" ]; then
-		slots=$(grep "max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
-		if [ ! -n "${slots}" ]; then
-			slots="NOT SET"
-		fi
-	else
-		slots="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# game mode
-	if [ -f "${servercfgfullpath}" ]; then
-		gamemode=$(grep "game_mode = " "${servercfgfullpath}" | grep -v "#" | sed 's/game_mode = //g')
-		if [ ! -n "${gamemode}" ]; then
-			gamemode="NOT SET"
-		fi
-	else
-		gamemode="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# tickrate
-	if [ -f "${servercfgfullpath}" ]; then
-		tickrate=$(grep "tick_rate" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
-		if [ ! -n "${tickrate}" ]; then
-			tickrate="NOT SET"
-		fi
-	else
-		tickrate="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${port}" ]; then
-		port="0"
-	fi
-
-## Project Zomboid
-elif [ "${engine}" == "projectzomboid" ]; then
-
-	# server name
-	if [ -f "${servercfgfullpath}" ]; then
-		servername=$(grep "PublicName=" "${servercfgfullpath}" | sed 's/PublicName=//g' | tr -d '=", \n')
-		if [ ! -n "${servername}" ]; then
-			servername="NOT SET"
-		fi
-	else
-		servername="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# slots
-	if [ -f "${servercfgfullpath}" ]; then
-		slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
-		if [ ! -n "${slots}" ]; then
-			slots="NOT SET"
-		fi
-	else
-		slots="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${port}" ]; then
-		port="0"
-	fi
-
-# ARMA 3
-elif [ "${engine}" == "realvirtuality" ]; then
-
-	# server name
-	if [ -f "${servercfgfullpath}" ]; then
-		servername=$(grep "hostname" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\<hostname\>//g' | tr -d '=\"; ')
-		if [ ! -n "${servername}" ]; then
-			servername="NOT SET"
-		fi
-	else
-		servername="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# admin password
-	if [ -f "${servercfgfullpath}" ]; then
-		adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\passwordAdmin//g' | tr -d '=\"; ')
-		if [ ! -n "${adminpassword}" ]; then
-			adminpassword="NOT SET"
-		fi
-	else
-		adminpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# server password
-	if [ -f "${servercfgfullpath}" ]; then
-		serverpassword=$(grep "password =" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\password//g' | tr -d '=\"; ')
-		if [ ! -n "${serverpassword}" ]; then
-			serverpassword="NOT SET"
-		fi
-	else
-		serverpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# slots
-	if [ -f "${servercfgfullpath}" ]; then
-		slots=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
-		if [ ! -n "${slots}" ]; then
-			slots="NOT SET"
-		fi
-	else
-		slots="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-        # port
-        if [ "${port}" != "" ]; then
-                        port=${port}
-        fi
-        if [ ! -n "${port}" ]; then
-                port="0"
-        fi
-
-        # query port
-        if [ "${port}" != "" ]; then
-                queryport=$((port+1))
-        fi
-        if [ ! -n "${queryport}" ]; then
-                queryport="0"
-        fi
-
-        # master port
-        if [ "${port}" != "" ]; then
-                masterport=$((port+2))
-        fi
-        if [ ! -n "${masterport}" ]; then
-                masterport="0"
-        fi
-
-# Serious Sam
-elif [ "${engine}" == "seriousengine35" ]; then
-
-	# server name
-	if [ -f "${servercfgfullpath}" ]; then
-		servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed 's/prj_strMultiplayerSessionName = //g' | tr -d '=\"; ')
-		if [ ! -n "${servername}" ]; then
-			servername="NOT SET"
-		fi
-	else
-		servername="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# rcon password
-	if [ -f "${servercfgfullpath}" ]; then
-		rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed 's/rcts_strAdminPassword = //g' | tr -d '=\"; ')
-		if [ ! -n "${rconpassword}" ]; then
-			rconpassword="NOT SET"
-		fi
-	else
-		rconpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# slots
-	if [ -f "${servercfgfullpath}" ]; then
-		slots=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
-		if [ ! -n "${slots}" ]; then
-			slots="NOT SET"
-		fi
-	else
-		slots="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# game mode
-	if [ -f "${servercfgfullpath}" ]; then
-		gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | grep -v "#" | sed 's/gam_idGameMode//g' | tr -d '=\"; ')
-		if [ ! -n "${gamemode}" ]; then
-			gamemode="NOT SET"
-		fi
-	else
-		gamemode="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "prj_uwPort" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${port}" ]; then
-		port="0"
-	fi
-
-	# query port
-	if [ -f "${servercfgfullpath}" ]; then
-		queryport=$((${port} + 1))
-	fi
-	if [ ! -n "${queryport}" ]; then
-		queryport="0"
-	fi
-
-# Source Engine Games
-elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
-
-	# server name
-	if [ -f "${servercfgfullpath}" ]; then
-		servername=$(grep "hostname" "${servercfgfullpath}" | sed 's/hostname //g' | sed 's/"//g')
-		if [ ! -n "${servername}" ]; then
-			servername="NOT SET"
-		fi
-	else
-		servername="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# server password
-	if [ -f "${servercfgfullpath}" ]; then
-		serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed 's/sv_password //g' | sed 's/"//g')
-		if [ ! -n "${serverpassword}" ]; then
-			serverpassword="NOT SET"
-		fi
-	else
-		serverpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# rcon password
-	if [ -f "${servercfgfullpath}" ]; then
-		rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed 's/rcon_password //g' | sed 's/"//g')
-		if [ ! -n "${rconpassword}" ]; then
-			rconpassword="NOT SET"
-		fi
-	else
-		rconpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-# Spark (NS2: Combat)
-elif [ "${engine}" == "spark" ]; then
-
-	# query port
-	if [ -f "${servercfgfullpath}" ]; then
-		queryport=$((port + 1))
-	fi
-	if [ ! -n "${queryport}" ]; then
-		queryport="0"
-	fi
-
-# Teamspeak 3
-elif [ "${gamename}" == "Teamspeak 3" ]; then
-
-	# ip
-	if [ -f "${servercfgfullpath}" ]; then
-		# check if the ip exists in the config file. Failing this will fall back to the default.
-		configipcheck=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g')
-	fi
-	if [ -n "${configipcheck}" ]; then
-		ip=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g')
-	fi
-
-	# dbplugin
-	if [ -f "${servercfgfullpath}" ]; then
-		dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed 's/\dbplugin=//g')
-		if [ ! -n "${dbplugin}" ]; then
-			dbplugin="NOT SET"
-		fi
-	else
-		dbplugin="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "default_voice_port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${port}" ]; then
-		port="9987"
-	fi
-
-	# query port
-	if [ -f "${servercfgfullpath}" ]; then
-		queryport=$(grep "query_port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${queryport}" ]; then
-		queryport="10011"
-	fi
-
-	# file port
-	if [ -f "${servercfgfullpath}" ]; then
-		fileport=$(grep "filetransfer_port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${fileport}" ]; then
-		fileport="30033"
-	fi
-
-# Teeworlds
-elif [ "${engine}" == "teeworlds" ]; then
-
-	# server name
-	if [ -f "${servercfgfullpath}" ]; then
-		servername=$(grep "sv_name" "${servercfgfullpath}" | sed 's/sv_name //g' | sed 's/"//g')
-		if [ ! -n "${servername}" ]; then
-			servername="unnamed server"
-		fi
-	else
-		servername="unnamed server"
-	fi
-
-	# server password
-	if [ -f "${servercfgfullpath}" ]; then
-		serverpassword=$(grep "password " "${servercfgfullpath}" | awk '!/sv_rcon_password/'| sed 's/password //g' | tr -d '=\"; ')
-		if [ ! -n "${serverpassword}" ]; then
-			serverpassword="NOT SET"
-		fi
-	else
-		serverpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi	
-
-	# rcon password
-	if [ -f "${servercfgfullpath}" ]; then
-		rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed 's/sv_rcon_password //g' | tr -d '=\"; ')
-		if [ ! -n "${rconpassword}" ]; then
-			rconpassword="NOT SET"
-		fi
-	else
-		rconpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${port}" ]; then
-		port="8303"
-	fi
-
-	# slots
-	if [ -f "${servercfgfullpath}" ]; then
-		slots=$(grep "sv_max_clients" "${servercfgfullpath}" | tr -cd '[:digit:]')
-		if [ ! -n "${slots}" ]; then
-			slots="12"
-		fi
-	else
-		slots="12"
-	fi
-
-# Terraria
-elif [ "${engine}" == "terraria" ]; then
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${port}" ]; then
-		port="0"
-	fi
-
-# 7 Day To Die (unity3d)
-elif [ "${gamename}" == "7 Days To Die" ]; then
-
-	# server name
-	if [ -f "${servercfgfullpath}" ]; then
-		servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
-		if [ ! -n "${servername}" ]; then
-			servername="NOT SET"
-		fi
-	else
-		servername="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# server password
-	if [ -f "${servercfgfullpath}" ]; then
-		serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
-		if [ ! -n "${serverpassword}" ]; then
-			serverpassword="NOT SET"
-		fi
-	else
-		serverpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# webadmin enabled
-	if [ -f "${servercfgfullpath}" ]; then
-		webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
-		if [ ! -n "${webadminenabled}" ]; then
-			webadminenabled="NOT SET"
-		fi
-	else
-		webadminenabled="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# webadmin port
-	if [ -f "${servercfgfullpath}" ]; then
-		webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${webadminport}" ]; then
-		webadminport="0"
-	fi
-
-	# webadmin enabled
-	if [ -f "${servercfgfullpath}" ]; then
-		webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
-		if [ ! -n "${webadminenabled}" ]; then
-			webadminenabled="NOT SET"
-		fi
-	else
-		webadminenabled="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# webadmin password
-	if [ -f "${servercfgfullpath}" ]; then
-		webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
-		if [ ! -n "${webadminpass}" ]; then
-			webadminpass="NOT SET"
-		fi
-	else
-		webadminpass="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# telnet enabled
-	if [ -f "${servercfgfullpath}" ]; then
-		telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
-		if [ ! -n "${telnetenabled}" ]; then
-			telnetenabled="NOT SET"
-		fi
-	else
-		telnetenabled="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# telnet port
-	if [ -f "${servercfgfullpath}" ]; then
-		telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${telnetport}" ]; then
-		telnetport="0"
-	fi
-
-	# telnet password
-	if [ -f "${servercfgfullpath}" ]; then
-		telnetpass=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
-		if [ ! -n "${telnetpass}" ]; then
-			telnetpass="NOT SET"
-		fi
-	else
-		telnetpass="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# slots
-	if [ -f "${servercfgfullpath}" ]; then
-		slots=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]')
-		if [ ! -n "${slots}" ]; then
-			slots="NOT SET"
-		fi
-	else
-		slots="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# game mode
-	if [ -f "${servercfgfullpath}" ]; then
-		gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
-		if [ ! -n "${gamemode}" ]; then
-			gamemode="NOT SET"
-		fi
-	else
-		gamemode="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# game world
-	if [ -f "${servercfgfullpath}" ]; then
-		gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
-		if [ ! -n "${gameworld}" ]; then
-			gameworld="NOT SET"
-		fi
-	else
-		gameworld="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${port}" ]; then
-		port="0"
-	fi
-
-	# query port
-	if [ -f "${servercfgfullpath}" ]; then
-		queryport=$((port + 1))
-	fi
-	if [ ! -n "${queryport}" ]; then
-		queryport="0"
-	fi
-
-# Hurtworld (unity3d)
-elif [ "${gamename}" == "Hurtworld" ]; then
-
-	# server name
-	if [ -n "${servername}" ]; then
-		servername="${servername}"
-	else
-		servername="\e[0;31mUNAVAILABLE\e[0m"	
-	fi
-
-	# server password
-	# not available yet
-
-	# slots
-	if [ -n "${maxplayers}" ]; then
-		slots="${maxplayers}"
-	else
-		slots="NOT SET"
-	fi
-
-	# game world
-	if [ -n "${map}" ]; then
-		gameworld="${map}"
-	else
-		gameworld="NO MAP SET"
-	fi
-
-	# port
-	if [ -n "${port}" ]; then
-		port="${port}"
-	else
-		port="0"
-	fi
-
-	# query port
-	if [ -n "${queryport}" ]; then
-		queryport="${queryport}"
-	else
-		queryport="0"
-	fi
-
-# Unreal Tournament 
-elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
-
-	# server name
-	if [ -f "${servercfgfullpath}" ]; then
-		servername=$(grep "ServerName=" "${servercfgfullpath}" | sed 's/ServerName=//g')
-		if [ ! -n "${servername}" ]; then
-			servername="NOT SET"
-		fi
-	else
-		servername="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# server password
-	if [ -f "${servercfgfullpath}" ]; then
-		serverpassword=$(grep "GamePassword=" "${servercfgfullpath}" | sed 's/GamePassword=//g')
-		if [ ! -n "${serverpassword}" ]; then
-			serverpassword="NOT SET"
-		fi
-	else
-		serverpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# admin password
-	if [ -f "${servercfgfullpath}" ]; then
-		adminpassword=$(grep "AdminPassword=" "${servercfgfullpath}" | sed 's/AdminPassword=//g')
-		if [ ! -n "${adminpassword}" ]; then
-			adminpassword="NOT SET"
-		fi
-	else
-		adminpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi	
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "Port=" "${servercfgfullpath}" | grep -v "Master" | grep -v "LAN" | grep -v "Proxy" | grep -v "Listen" | tr -d '\r' | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${port}" ]; then
-		port="0"
-	fi
-
-	# query port
-	if [ -f "${servercfgfullpath}" ]; then
-		queryport=$((port + 1))
-	fi
-	if [ ! -n "${queryport}" ]; then
-		queryport="0"
-	fi
-
-	# gamespy query port
-	if [ -f "${servercfgfullpath}" ]; then
-		gsqueryport=$(grep "OldQueryPortNumber=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${gsqueryport}" ]; then
-		gsqueryport="0"
-	fi
-
-	# query port
-	if [ -f "${servercfgfullpath}" ]; then
-		udplinkport=$((port + 2))
-	fi
-	if [ ! -n "${udplinkport}" ]; then
-		udplinkport="0"
-	fi
-
-	# webadmin enabled
-	if [ -f "${servercfgfullpath}" ]; then
-		webadminenabled=$(grep "bEnabled=" "${servercfgfullpath}" | sed 's/bEnabled=//g' | tr -d '\r')
-		if [ ! -n "${webadminenabled}" ]; then
-			webadminenabled="NOT SET"
-		fi
-	else
-		webadminenabled="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# webadmin port
-	if [ -f "${servercfgfullpath}" ]; then
-		webadminport=$(grep "ListenPort=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${webadminport}" ]; then
-		webadminport="0"
-	fi
-
-	if [ "${engine}" == "unreal" ]; then
-
-		# webadmin user
-		if [ -f "${servercfgfullpath}" ]; then
-			webadminuser=$(grep "AdminUsername=" "${servercfgfullpath}" | sed 's/\AdminUsername=//g')
-			if [ ! -n "${webadminuser}" ]; then
-				webadminuser="NOT SET"
-			fi
-		else
-			webadminuser="\e[0;31mUNAVAILABLE\e[0m"
-		fi
-
-		# webadmin password
-		if [ -f "${servercfgfullpath}" ]; then
-			webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 2 | grep "AdminPassword=" | sed 's/\AdminPassword=//g')
-			if [ ! -n "${webadminpass}" ]; then
-				webadminpass="NOT SET"
-			fi
-		else
-			webadminpass="\e[0;31mUNAVAILABLE\e[0m"
-		fi
-
-	else
-
-		# webadmin user
-		if [ -f "${servercfgfullpath}" ]; then
-			webadminuser=$(grep "AdminName=" "${servercfgfullpath}" | sed 's/\AdminName=//g')
-			if [ ! -n "${webadminuser}" ]; then
-				webadminuser="NOT SET"
-			fi
-		else
-			webadminuser="\e[0;31mUNAVAILABLE\e[0m"
-		fi
-
-		# webadmin password
-		if [ -f "${servercfgfullpath}" ]; then
-			webadminpass=$(grep "AdminPassword=" "${servercfgfullpath}" | sed 's/\AdminPassword=//g')
-			if [ ! -n "${webadminpass}" ]; then
-				webadminpass="NOT SET"
-			fi
-		else
-			webadminpass="\e[0;31mUNAVAILABLE\e[0m"
-		fi
-
-	fi
-
-# ARK: Survivaial Evolved
-elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
-
-	# server name
-	if [ -f "${servercfgfullpath}" ]; then
-		servername=$(grep "SessionName=" "${servercfgfullpath}" | sed 's/SessionName=//g')
-		if [ ! -n "${servername}" ]; then
-			servername="NOT SET"
-		fi
-	else
-		servername="\e[0;31mUNAVAILABLE\e[0m"
-	fi	
-
-	# server password
-	if [ -f "${servercfgfullpath}" ]; then
-		serverpassword=$(grep "ServerPassword=" "${servercfgfullpath}" | sed 's/ServerPassword=//g')
-		if [ ! -n "${serverpassword}" ]; then
-			serverpassword="NOT SET"
-		fi
-	else
-		serverpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# admin password
-	if [ -f "${servercfgfullpath}" ]; then
-	adminpassword=$(grep "ServerAdminPassword=" "${servercfgfullpath}" | sed 's/ServerAdminPassword=//g')
-		if [ ! -n "${adminpassword}" ]; then
-			adminpassword="NOT SET"
-		fi
-	else
-		adminpassword="\e[0;31mUNAVAILABLE\e[0m"
-	fi	
-
-	# slots
-	if [ -f "${servercfgfullpath}" ]; then
-		slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]')
-		if [ ! -n "${slots}" ]; then
-			slots="NOT SET"
-		fi
-	else
-		slots="\e[0;31mUNAVAILABLE\e[0m"
-	fi
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "Port=" "${servercfgfullpath}" | grep -v  "RCONPort=" | grep -v  "QueryPort=" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${port}" ]; then
-		port="0"
-	fi
-
-	# rcon port
-	if [ -f "${servercfgfullpath}" ]; then
-		rconport=$(grep "RCONPort=" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${rconport}" ]; then
-		rconport="0"
-	fi
-
-	# query port
-	if [ -f "${servercfgfullpath}" ]; then
-			queryport=$(grep "QueryPort=" "${servercfgfullpath}" | tr -cd '[:digit:]')
-	fi
-	if [ ! -n "${queryport}" ]; then
-		queryport="0"
-	fi
-
-fi

+ 0 - 10
functions/info_ts3status.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-# LGSM info_ts3status.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-# Checks the status of Teamspeak 3.
-
-cd "${executabledir}"
-ts3status=$(./ts3server_startscript.sh status servercfgfullpathfile=${servercfgfullpath})

+ 0 - 54
functions/install_dl_ut2k4.sh

@@ -1,54 +0,0 @@
-#!/bin/bash
-# LGSM install_dl_ut2k4.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-echo ""
-echo "Downloading Server Files"
-echo "================================="
-sleep 1
-cd "${filesdir}"
-if [ ! -f dedicatedserver3339-bonuspack.zip ]; then
-	wget http://gameservermanagers.com/files/ut2004/dedicatedserver3339-bonuspack.zip
-else
-	echo "dedicatedserver3339-bonuspack.zip already downloaded!"
-fi
-echo "Running MD5 checksum to verify the file"
-sleep 1
-echo "MD5 checksum: d3f28c5245c4c02802d48e4f0ffd3e34"
-md5check=$(md5sum dedicatedserver3339-bonuspack.zip|awk '{print $1;}')
-echo "File returned: ${md5check}"
-if [ "${md5check}" != "d3f28c5245c4c02802d48e4f0ffd3e34" ]; then
-	echo "MD5 checksum: FAILED!"
-	read -p "Retry download? [y/N]" yn
-	case $yn in
-	[Yy]* ) rm -fv dedicatedserver3339-bonuspack.zip; install_dl_ut2k4.sh;;
-	[Nn]* ) echo Exiting; exit;;
-	* ) echo "Please answer yes or no.";;
-	esac
-else
-	echo "MD5 checksum: PASSED"
-fi
-if [ ! -f ut2004-lnxpatch3369-2.tar.bz2 ]; then
-	wget http://gameservermanagers.com/files/ut2004/ut2004-lnxpatch3369-2.tar.bz2
-else
-	echo "ut2004-lnxpatch3369-2.tar.bz2 already downloaded!"
-fi
-echo "Running MD5 checksum to verify the file"
-sleep 1
-echo "MD5 checksum: 0fa447e05fe5a38e0e32adf171be405e"
-md5check=$(md5sum ut2004-lnxpatch3369-2.tar.bz2|awk '{print $1;}')
-echo "File returned: ${md5check}"
-if [ "${md5check}" != "0fa447e05fe5a38e0e32adf171be405e" ]; then
-	echo "MD5 checksum: FAILED!"
-	read -p "Retry download? [y/N]" yn
-	case $yn in
-	[Yy]* ) rm -fv ut2004-lnxpatch3369-2.tar.bz2; install_dl_ut2k4.sh;;
-	[Nn]* ) echo Exiting; exit;;
-	* ) echo "Please answer yes or no.";;
-	esac
-else
-	echo "MD5 checksum: PASSED"
-fi
-echo ""

+ 0 - 54
functions/install_dl_ut99.sh

@@ -1,54 +0,0 @@
-#!/bin/bash
-# LGSM install_dl_ut99.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-echo ""
-echo "Downloading Server Files"
-echo "================================="
-sleep 1
-cd "${filesdir}"
-if [ ! -f ut-server-436.tar.gz ]; then
-	wget http://gameservermanagers.com/files/ut99/ut-server-436.tar.gz
-else
-	echo "ut-server-436.tar.gz already downloaded!"
-fi
-echo "Running MD5 checksum to verify the file"
-sleep 1
-echo "MD5 checksum: 10cd7353aa9d758a075c600a6dd193fd"
-md5check=$(md5sum ut-server-436.tar.gz|awk '{print $1;}')
-echo "File returned: ${md5check}"
-if [ "${md5check}" != "10cd7353aa9d758a075c600a6dd193fd" ]; then
-	echo "MD5 checksum: FAILED!"
-	read -p "Retry download? [y/N]" yn
-	case $yn in
-	[Yy]* ) rm -fv ut-server-436.tar.gz; fn_filesdl;;
-	[Nn]* ) echo Exiting; exit;;
-	* ) echo "Please answer yes or no.";;
-	esac
-else
-	echo "MD5 checksum: PASSED"
-fi
-if [ ! -f UTPGPatch451.tar.bz2 ]; then
-	wget http://gameservermanagers.com/files/ut99/UTPGPatch451.tar.bz2
-else
-	echo "UTPGPatch451.tar.bz2 already downloaded!"
-fi
-echo "Running MD5 checksum to verify the file"
-sleep 1
-echo "MD5 checksum: 77a735a78b1eb819042338859900b83b"
-md5check=$(md5sum UTPGPatch451.tar.bz2|awk '{print $1;}')
-echo "File returned: ${md5check}"
-if [ "${md5check}" != "77a735a78b1eb819042338859900b83b" ]; then
-	echo "MD5 checksum: FAILED!"
-	read -p "Retry download? [y/N]" yn
-	case $yn in
-	[Yy]* ) rm -fv UTPGPatch451.tar.bz2; fn_filesdl;;
-	[Nn]* ) echo Exiting; exit;;
-	* ) echo "Please answer yes or no.";;
-	esac
-else
-	echo "MD5 checksum: PASSED"
-fi
-echo ""

+ 0 - 42
functions/install_gslt.sh

@@ -1,42 +0,0 @@
-#!/bin/bash
-# LGSM install_gslt.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-# Description: Configures GSLT.
-
-if [ -z "${autoinstall}" ]; then
-	echo ""
-	echo "Game Server Login Token"
-	echo "============================"
-	sleep 1
-	if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
-		echo "GSLT is required to run a public ${gamename} server"
-	else
-		echo "GSLT is an optional feature for ${gamename} server"
-	fi
-
-	echo "Get more info and a token here:"
-	echo "http://gameservermanagers.com/gslt"
-	echo ""
-	echo "Enter token below (Can be blank)."
-	echo -n "GSLT TOKEN: "
-	read token
-	sed -i -e "s/gslt=\"\"/gslt=\"${token}\"/g" "${rootdir}/${selfname}"
-	sleep 1
-	echo "The GSLT can be changed by editing ${selfname}."
-	echo ""
-else
-	if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
-		fn_printinfomationnl "GSLT is required to run a public ${gamename} server"
-	else
-		fn_printinfomationnl "GSLT is an optional feature for ${gamename} server"
-	fi
-	echo "Get more info and a token here:"
-	echo "http://gameservermanagers.com/gslt"
-	echo ""	
-	sleep 1
-	echo "The GSLT can be changed by editing ${selfname}."	
-	sleep 1
-fi

+ 0 - 30
functions/install_gsquery.sh

@@ -1,30 +0,0 @@
-#!/bin/bash
-# LGSM install_gsquery.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-fn_dlgsquery(){
-cd "${rootdir}"
-echo -e "downloading gsquery.py...\c"
-wget -N /dev/null "http://gameservermanagers.com/dl/gsquery.py" 2>&1 | grep -F "HTTP" | grep -v "Moved Permanently" | cut -c45- | uniq
-chmod +x gsquery.py
-}
-
-if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${gamename}" == "Hurtworld" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
-	echo ""
-	echo "GameServerQuery"
-	echo "============================"
-	if [ -z ${autoinstall} ]; then
-		while true; do
-			read -e -i "y" -p "Do you want to install GameServerQuery? [Y/n]" yn
-			case $yn in
-			[Yy]* ) fn_dlgsquery;break;;
-			[Nn]* ) echo ""; echo "Not installing GameServerQuery.";break;;
-			* ) echo "Please answer yes or no.";;
-		esac
-		done
-	else
-		fn_dlgsquery
-	fi
-fi

+ 0 - 20
functions/install_header.sh

@@ -1,20 +0,0 @@
-#!/bin/bash
-# LGSM install_header.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-clear
-echo "================================="
-echo "${gamename}"
-echo "Linux Game Server Manager"
-echo "by Daniel Gibbs"
-if [ "${gamename}" == "ARMA 3" ]; then
-	echo "contributions by Scarsz"
-elif [ "${gamename}" == "Left 4 Dead" ]; then
-	echo "contributions by Summit Singh Thakur"
-elif [ "${gamename}" == "Teeworlds" ]; then
-	echo "contributions by Bryce Van Dyk (SingingTree)"	
-fi
-echo "http://gameservermanagers.com"
-echo "================================="

+ 0 - 87
functions/install_serverfiles.sh

@@ -1,87 +0,0 @@
-#!/bin/bash
-# LGSM finstall_serverfiles.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-fn_steaminstallcommand(){
-check.sh
-counter="0"
-while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .finstall_serverfiles.sh.tmp)" -ge "1" ]||[ "$(grep -wc 0x406 .finstall_serverfiles.sh.tmp)" -ge "1" ]||[ "$(grep -wc 0x6 .finstall_serverfiles.sh.tmp)" -ge "1" ]||[ "$(grep -wc 0x106 .finstall_serverfiles.sh.tmp)" -ge "1" ]; do
-	counter=$((counter+1))
-	cd "${rootdir}/steamcmd"
-	if [ "${counter}" -le "10" ]; then
-		# Attempt 1-4: Standard attempt
-		# Attempt 5-6: Validate attempt
-		# Attempt 7-8: Validate, delete long name dir
-		# Attempt 9-10: Validate, delete long name dir, re-download SteamCMD
-		# Attempt 11: Failure
-
-		if [ "${counter}" -ge "2" ]; then
-			fn_printwarningnl "SteamCMD did not complete the download, retrying: Attempt ${counter}:"
-		fi
-
-		if [ "${counter}" -ge "7" ]; then
-			echo "Removing $(find ${filesdir} -type d -print0 | grep -Ez '[^/]{30}$')"
-			find ${filesdir} -type d -print0 | grep -Ez '[^/]{30}$' | xargs -0 rm -rf
-		fi
-		if [ "${counter}" -ge "9" ]; then
-			rm -rf "${rootdir}/steamcmd"
-			check_steamcmd.sh
-		fi
-
-		# Detects if unbuffer command is available.
-		if [ $(command -v unbuffer) ]; then
-			unbuffer=unbuffer
-		fi
-
-		if [ "${counter}" -le "4" ]; then
-			if [ "${engine}" == "goldsource" ]; then
-				${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +quit |tee .finstall_serverfiles.sh.tmp
-			else
-				${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .finstall_serverfiles.sh.tmp
-			fi
-		elif [ "${counter}" -ge "5" ]; then
-			if [ "${engine}" == "goldsource" ]; then
-				${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" -validate +quit |tee .finstall_serverfiles.sh.tmp
-			else
-				${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .finstall_serverfiles.sh.tmp
-			fi
-		fi
-	elif [ "${counter}" -ge "11" ]; then
-		fn_printfailurenl "SteamCMD did not complete the download, too many retrys"
-		break
-	fi
-
-done
-
-# Goldsource servers commonly fail to download all the server files required.
-# Validating a few of times may reduce the chance of this issue.
-if [ "${engine}" == "goldsource" ]; then
-	counter="0"
-	while [ "${counter}" -le "4" ]; do
-		counter=$((counter+1))
-		${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" -validate +quit |tee .finstall_serverfiles.sh.tmp
-	done
-fi
-rm -f .finstall_serverfiles.sh.tmp
-}
-
-echo ""
-echo "Installing ${gamename} Server"
-echo "================================="
-sleep 1
-mkdir -pv "${filesdir}"
-fn_steaminstallcommand
-if [ -z "${autoinstall}" ]; then
-	echo ""
-	echo "================================="
-	while true; do
-	read -e -i "y" -p "Was the install successful? [Y/n]" yn
-		case $yn in
-			[Yy]* ) break;;
-			[Nn]* ) install_retry.sh;;
-			* ) echo "Please answer yes or no.";;
-		esac
-	done
-fi

+ 0 - 42
functions/install_ut2k4.sh

@@ -1,42 +0,0 @@
-#!/bin/bash
-# LGSM install_ut2k4.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-echo ""
-echo "Installing ${gamename} Server"
-echo "================================="
-sleep 1
-cd "${filesdir}"
-echo "Extracting dedicatedserver3339-bonuspack.zip"
-sleep 1
-unzip dedicatedserver3339-bonuspack.zip
-echo "Extracting ut2004-lnxpatch3369-2.tar.bz2"
-sleep 1
-tar -xvjf ut2004-lnxpatch3369-2.tar.bz2 UT2004-Patch/ --strip-components=1
-while true; do
-	read -p "Was the install successful? [y/N]" yn
-	case $yn in
-	[Yy]* ) break;;
-	[Nn]* ) install_retry.sh;;
-	* ) echo "Please answer yes or no.";;
-esac
-done
-while true; do
-	read -p "Remove ut2004-lnxpatch3369-2.tar.bz2? [y/N]" yn
-	case $yn in
-	[Yy]* ) rm -fv ut2004-lnxpatch3369-2.tar.bz2; break;;
-	[Nn]* ) break;;
-	* ) echo "Please answer yes or no.";;
-	esac
-done
-while true; do
-	read -p "Remove dedicatedserver3339-bonuspack.zip? [y/N]" yn
-	case $yn in
-	[Yy]* ) rm -fv dedicatedserver3339-bonuspack.zip; break;;
-	[Nn]* ) break;;
-	* ) echo "Please answer yes or no.";;
-	esac
-done
-echo ""

+ 0 - 19
functions/install_ut2k4_key.sh

@@ -1,19 +0,0 @@
-#!/bin/bash
-# LGSM install_ut2k4_key.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-echo ""
-echo "Enter ${gamename} CD Key"
-echo "================================="
-sleep 1
-echo "To get your server listed on the Master Server list"
-echo "you must get a free CD key. Get a key here:"
-echo "http://www.unrealtournament.com/ut2004server/cdkey.php"
-echo ""
-echo "Once you have the key enter it below"
-echo -n "KEY: "
-read CODE
-echo ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey"
-echo ""

+ 0 - 42
functions/install_ut99.sh

@@ -1,42 +0,0 @@
-#!/bin/bash
-# LGSM install_ut99.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-echo ""
-echo "Installing ${gamename} Server"
-echo "================================="
-sleep 1
-cd "${filesdir}"
-echo "Extracting ut-server-436.tar.gz"
-sleep 1
-tar -zxvf ut-server-436.tar.gz ut-server/ --strip-components=1
-echo "Extracting UTPGPatch451.tar.bz2"
-sleep 1
-tar -jxvf UTPGPatch451.tar.bz2
-while true; do
-	read -p "Was the install successful? [y/N]" yn
-	case $yn in
-	[Yy]* ) break;;
-	[Nn]* ) install_retry.sh;;
-	* ) echo "Please answer yes or no.";;
-esac
-done
-while true; do
-	read -p "Remove ut-server-436.tar.gz? [y/N]" yn
-	case $yn in
-	[Yy]* ) rm -fv ut-server-436.tar.gz; break;;
-	[Nn]* ) break;;
-	* ) echo "Please answer yes or no.";;
-	esac
-done
-while true; do
-	read -p "Remove UTPGPatch451.tar.bz2? [y/N]" yn
-	case $yn in
-	[Yy]* ) rm -fv UTPGPatch451.tar.bz2; break;;
-	[Nn]* ) break;;
-	* ) echo "Please answer yes or no.";;
-	esac
-done
-echo ""

+ 0 - 65
functions/logs.sh

@@ -1,65 +0,0 @@
-#!/bin/bash
-# LGSM logs.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-# Description: Acts as a log rotater, removing old logs.
-
-local modulename="Log Manager"
-
-if [ -n "${consolelog}" ]; then
-	if [ ! -e "${consolelog}" ]; then
-		touch "${consolelog}"
-	fi
-fi
-# log manager will active if finds logs older than ${logdays}
-if [ $(find "${scriptlogdir}"/ -type f -mtime +${logdays}|wc -l) -ne "0" ]; then
-	fn_printdots "Starting"
-	sleep 1
-	fn_printok "Starting"
-	fn_scriptlog "Starting"
-	sleep 1
-	echo -en "\n"
-	fn_printinfo "Removing logs older than ${logdays} days"
-	fn_scriptlog "Removing logs older than ${logdays} days"
-	sleep 1
-	echo -en "\n"
-	if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then
-		find "${gamelogdir}"/ -type f -mtime +${logdays}|tee >> "${scriptlog}"
-	fi
-	find "${scriptlogdir}"/ -type f -mtime +${logdays}|tee >> "${scriptlog}"
-	if [ -n "${consolelog}" ]; then
-		find "${consolelogdir}"/ -type f -mtime +${logdays}|tee >> "${scriptlog}"
-	fi
-	if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then
-		gamecount=$(find "${scriptlogdir}"/ -type f -mtime +${logdays}|wc -l)
-	fi
-	scriptcount=$(find "${scriptlogdir}"/ -type f -mtime +${logdays}|wc -l)
-	echo "${consolelog}"
-	if [ -n "${consolelog}" ]; then
-		consolecount=$(find "${consolelogdir}"/ -type f -mtime +${logdays}|wc -l)
-	else
-		consolecount=0
-	fi
-
-	count=$((${scriptcount} + ${consolecount}))
-	if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then
-		count=$((${scriptcount} + ${consolecount} + ${gamecount}))
-	else
-		count=$((${scriptcount} + ${consolecount}))
-	fi
-
-
-	if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then
-		find "${gamelogdir}"/ -mtime +${logdays} -type f -exec rm -f {} \;
-	fi
-	find "${scriptlogdir}"/ -mtime +${logdays} -type f -exec rm -f {} \;
-	if [ -n "${consolelog}" ]; then
-		find "${consolelogdir}"/ -mtime +${logdays} -type f -exec rm -f {} \;
-	fi
-	fn_printok "Removed ${count} log files"
-	fn_scriptlog "Removed ${count} log files"
-	sleep 1
-	echo -en "\n"
-fi

+ 0 - 97
functions/monitor_gsquery.sh

@@ -1,97 +0,0 @@
-#!/bin/bash
-# LGSM monitor_gsquery.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="271215"
-
-# Description: uses gsquery.py to directly query the server.
-# Detects if the server has frozen.
-
-local modulename="Monitor"
-if [ -f "${rootdir}/gsquery.py" ]; then
-	if [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
-		gameport=$(grep Port= "${servercfgfullpath}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|tr -d '\r'|tr -cd '[:digit:]')
-		port=$((${gameport} + 1))
-	elif [ "${engine}" == "spark" ]; then
-		port=$((${port} + 1))
-	elif [ "${engine}" == "realvirtuality" ]; then
-		queryport=$(grep -s steamqueryport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd '[:digit:]')
-		port=${queryport}
-	elif [ "${gamename}" == "7 Days To Die" ]; then
-		gameport=$(grep ServerPort "${servercfgfullpath}"|tr -cd '[:digit:]')
-		port=$((${gameport} + 1))
-	elif [ "${gamename}" == "Hurtworld" ]; then
-		gameport="${port}"
-		port="${queryport}"
-	fi
-	fn_printinfo "Detected gsquery.py"
-	fn_scriptlog "Detected gsquery.py"
-	sleep 1
-	fn_printdots "Querying port: ${ip}:${port} : QUERYING"
-	fn_scriptlog "Querying port: ${ip}:${port} : QUERYING"
-	sleep 1
-	serverquery=$("${rootdir}/gsquery.py" -a ${ip} -p ${port} -e ${engine} 2>&1)
-	exitcode=$?
-	if [ "${exitcode}" == "1" ]||[ "${exitcode}" == "2" ]||[ "${exitcode}" == "3" ]||[ "${exitcode}" == "4" ]; then
-		fn_printfail "Querying port: ${ip}:${port} : ${serverquery}"
-		fn_scriptlog "Querying port: ${ip}:${port} : ${serverquery}"
-		sleep 1
-		echo -en "\n"
-		if [ -z "${secondquery}" ]; then
-			if [ "${engine}" == "unreal2" ]; then
-				# unreal 2: Map change can take around 60 seconds
-				fn_printinfo "Waiting 60 seconds to re-query"
-				fn_scriptlog "Waiting 60 seconds to re-query"
-				sleep 60
-			else
-				fn_printinfo "Waiting 30 seconds to re-query"
-				fn_scriptlog "Waiting 30 seconds to re-query"
-				sleep 30
-			fi
-			secondquery=1
-			monitor_gsquery.sh
-		fi
-		if [ "${emailnotification}" = "on" ]; then
-			info_config.sh
-			subject="${servicename} Monitor - Starting ${servername}"
-			failurereason="Failed to query ${servicename}: ${serverquery}"
-			actiontaken="restarted ${servicename}"
-			email.sh
-		fi
-		fn_restart
-		exit 1
-	elif [ "${exitcode}" == "0" ]; then
-		fn_printok "Querying port: ${ip}:${port} : OK"
-		fn_scriptlog "Querying port: ${ip}:${port} : OK"
-		sleep 1
-		echo -en "\n"
-		exit
-	elif [ "${exitcode}" == "126" ]; then
-		fn_printfail "Querying port: ${ip}:${port} : ERROR: ${rootdir}/gsquery.py: Permission denied"
-		fn_scriptlog "Querying port: ${ip}:${port} : ERROR: ${rootdir}/gsquery.py: Permission denied"
-		sleep 1
-		echo -en "\n"
-		echo "Attempting to resolve automatically"
-		chmod +x -v "${rootdir}/gsquery.py"
-		if [ $? -eq 0 ]; then
-			monitor_gsquery.sh
-		else
-			fn_printfailure "Unable to resolve automatically. Please manually fix permissions.\n"
-			owner=$(ls -al ${rootdir}/gsquery.py|awk '{ print $3 }')
-			echo "As user ${owner} or root run the following command."
-			whoami=$(whoami)
-			echo -en "\nchown ${whoami}:${whoami} ${rootdir}/gsquery.py\n\n"
-		exit 1
-		fi
-	else
-		fn_printfail "Querying port: ${ip}:${port} : UNKNOWN ERROR"
-		fn_scriptlog "Querying port: ${ip}:${port} : UNKNOWN ERROR"
-		sleep 1
-		echo -en "\n"
-		${rootdir}/gsquery.py -a ${ip} -p ${port} -e ${engine}
-		exit 1
-	fi
-else
-	fn_printfailnl "Could not find ${rootdir}/gsquery.py"
-	fn_scriptlog "Could not find ${rootdir}/gsquery.py"
-fi

+ 0 - 318
functions/update_check.sh

@@ -1,318 +0,0 @@
-#!/bin/bash
-# LGSM update_check.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="020216"
-
-# Description: Checks if a server update is available.
-
-local modulename="Update"
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-### SteamCMD Update Checker ###
-
-fn_appmanifestinfo(){
-	appmanifestfile=$(find "${filesdir}" -type f -name "appmanifest_${appid}.acf")
-	appmanifestfilewc=$(find "${filesdir}" -type f -name "appmanifest_${appid}.acf"|wc -l)
-}
-
-fn_appmanifestcheck(){
-fn_appmanifestinfo
-# Multiple or no matching appmanifest files may sometimes be available.
-# This is an error is corrected below if required.
-if [ "${appmanifestfilewc}" -ge "2" ]; then
-	sleep 1
-	fn_printwarn "Multiple appmanifest_${appid}.acf files found"
-	fn_scriptlog "Warning! Multiple appmanifest_${appid}.acf files found"
-	sleep 2
-	fn_printdots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files"
-	sleep 1
-	for appfile in ${appmanifestfile}; do
-		rm "${appfile}"
-	done
-	appmanifestfilewc1="${appmanifestfilewc}"
-	fn_appmanifestinfo
-	if [ "${appmanifestfilewc}" -ge "2" ]; then
-		fn_printfail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
-		fn_scriptlog "Failure! Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
-		sleep 1
-		echo ""
-		echo "	Check user permissions"
-		for appfile in ${appmanifestfile}; do
-			echo "	${appfile}"
-		done
-		exit 1
-	else
-		sleep 1
-		fn_printok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
-		fn_scriptlog "Success! Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
-		sleep 1
-		fn_printinfonl "Forcing update to correct issue"
-		fn_scriptlog "Forcing update to correct issue"
-		sleep 1
-		update_dl.sh
-		update_check.sh
-	fi
-elif [ "${appmanifestfilewc}" -eq "0" ]; then
-	if [ "${forceupdate}" == "1" ]; then
-		fn_printfail "Still no appmanifest_${appid}.acf found: Unable to update"
-		fn_scriptlog "Warning! Still no appmanifest_${appid}.acf found: Unable to update"
-		exit 1
-	fi
-	forceupdate=1
-	fn_printwarn "No appmanifest_${appid}.acf found"
-	fn_scriptlog "Warning! No appmanifest_${appid}.acf found"
-	sleep 2
-	fn_printinfonl "Forcing update to correct issue"
-	fn_scriptlog "Forcing update to correct issue"
-	sleep 1
-	update_dl.sh
-	update_check.sh
-fi
-}
-
-fn_logupdaterequest(){
-# Checks for server update requests from server logs.
-fn_printdots "Checking for update: Server logs"
-fn_scriptlog "Checking for update: Server logs"
-sleep 1
-requestrestart=$(grep -Ec "MasterRequestRestart" "${consolelog}")
-if [ "${requestrestart}" -ge "1" ]; then
-	fn_printoknl "Checking for update: Server logs: Update requested"
-	sleep 1
-	echo ""
-	echo -ne "Applying update.\r"
-	sleep 1
-	echo -ne "Applying update..\r"
-	sleep 1
-	echo -ne "Applying update...\r"
-	sleep 1
-	echo -ne "\n"
-	tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
-	if [ "${tmuxwc}" -eq 1 ]; then
-		command_stop.sh
-		update_dl.sh
-		command_start.sh
-	else
-		update_dl.sh
-	fi
-else
-	fn_printok "Checking for update: Server logs: No update requested"
-	sleep 1
-fi
-}
-
-fn_steamcmdcheck(){
-fn_appmanifestcheck
-# Checks for server update from SteamCMD
-fn_printdots "Checking for update: SteamCMD"
-fn_scriptlog "Checking for update: SteamCMD"
-sleep 1
-
-# Gets currentbuild
-currentbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
-
-# Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD
-
-# Gets availablebuild info
-cd "${rootdir}/steamcmd"
-if [ -f "${HOME}/Steam/appcache/appinfo.vdf" ]; then
-	rm -f "${HOME}/Steam/appcache/appinfo.vdf"
-fi
-availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"public\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
-if [ -z "${availablebuild}" ]; then
-	fn_printfail "Checking for update: SteamCMD"
-	fn_scriptlog "Failure! Checking for update: SteamCMD"
-	sleep 1
-	fn_printfailnl "Checking for update: SteamCMD: Not returning version info"
-	fn_scriptlog "Failure! Checking for update: SteamCMD: Not returning version info"
-	exit 1
-else
-	fn_printok "Checking for update: SteamCMD"
-	fn_scriptlog "Success! Checking for update: SteamCMD"
-	sleep 1
-fi
-
-if [ "${currentbuild}" != "${availablebuild}" ]; then
-	echo -e "\n"
-	echo -e "Update available:"
-	sleep 1
-	echo -e "	Current build: \e[0;31m${currentbuild}\e[0;39m"
-	echo -e "	Available build: \e[0;32m${availablebuild}\e[0;39m"
-	echo -e ""
-	echo -e "	https://steamdb.info/app/${appid}/"
-	sleep 1
-	echo ""
-	echo -en "Applying update.\r"
-	sleep 1
-	echo -en "Applying update..\r"
-	sleep 1
-	echo -en "Applying update...\r"
-	sleep 1
-	echo -en "\n"
-	fn_scriptlog "Update available"
-	fn_scriptlog "Current build: ${currentbuild}"
-	fn_scriptlog "Available build: ${availablebuild}"
-	fn_scriptlog "${currentbuild} > ${availablebuild}"
-
-	tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
-	if [ "${tmuxwc}" -eq 1 ]; then
-		command_stop.sh
-		update_dl.sh
-		command_start.sh
-	else
-		update_dl.sh
-	fi
-else
-	echo -e "\n"
-	echo -e "No update available:"
-	echo -e "	Current version: \e[0;32m${currentbuild}\e[0;39m"
-	echo -e "	Available version: \e[0;32m${availablebuild}\e[0;39m"
-	echo -e "	https://steamdb.info/app/${appid}/"
-	echo -e ""
-	fn_printoknl "No update available"
-	fn_scriptlog "Current build: ${currentbuild}"
-	fn_scriptlog "Available build: ${availablebuild}"
-fi
-}
-
-### END SteamCMD Update Checker ###
-
-fn_teamspeak3_check(){
-# Checks for server update from teamspeak.com using a mirror dl.4players.de
-fn_printdots "Checking for update: teamspeak.com"
-fn_scriptlog "Checking for update: teamspeak.com"
-sleep 1
-
-# Gets currentbuild info
-# Checks currentbuild info is available, if fails a server restart will be forced to generate logs
-if [ -z "$(find ./* -name 'ts3server*_0.log')" ]; then
-	fn_printfail "Checking for update: teamspeak.com"
-	sleep 1
-	fn_printfailnl "Checking for update: teamspeak.com: No logs with server version found"
-	fn_scriptlog "Failure! Checking for update: teamspeak.com: No logs with server version found"
-	sleep 2
-	fn_printinfonl "Checking for update: teamspeak.com: Forcing server restart"
-	fn_scriptlog "Checking for update: teamspeak.com: Forcing server restart"
-	sleep 2
-	command_stop.sh
-	command_start.sh
-	sleep 2
-	# If still failing will exit
-	if [ -z "$(find ./* -name 'ts3server*_0.log')" ]; then
-		fn_printfailnl "Checking for update: teamspeak.com: Still No logs with server version found"
-		fn_scriptlog "Failure! Checking for update: teamspeak.com: Still No logs with server version found"
-		exit 1
-	fi
-fi
-currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}')
-
-# Gets the teamspeak server architecture
-ts3arch=$(ls $(find ${filesdir}/ -name 'ts3server_*_*' 2> /dev/null | grep -v 'ts3server_minimal_runscript.sh' | sort | tail -1) | egrep -o '(amd64|x86)' | tail -1)
-
-# Gets availablebuild info
-
-# Grabs all version numbers but not in correct order
-wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '<a href=\".*\/\">.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > .ts3_version_numbers_unsorted.tmp
-
-# Replaces dots with spaces to split up the number. e.g 3 0 12 1 is 3.0.12.1 this allows correct sorting
- cat .ts3_version_numbers_unsorted.tmp | tr "." " " > .ts3_version_numbers_digit.tmp
-# Sorts versions in to correct order
-# merges 2 files and orders by each column in order allowing these version numbers to be sorted in order
-paste .ts3_version_numbers_digit.tmp .ts3_version_numbers_unsorted.tmp | awk '{print $1,$2,$3,$4 " " $0;}'| sort  -k1rn -k2rn -k3rn -k4rn | awk '{print $NF}' > .ts3_version_numbers.tmp
-
-# Finds directory with most recent server version.
-while read ts3_version_number; do
-	wget --spider -q "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"
-	if [ $? -eq 0 ]; then
-		availablebuild="${ts3_version_number}"
-		# Break while-loop, if the latest release could be found
-		break
-	fi
-done < .ts3_version_numbers.tmp
-
-# tidy up
-rm -f ".ts3_version_numbers_digit.tmp"
-rm -f ".ts3_version_numbers_unsorted.tmp"
-rm -f ".ts3_version_numbers.tmp"
-
-# Checks availablebuild info is available
-if [ -z "${availablebuild}" ]; then
-	fn_printfail "Checking for update: teamspeak.com"
-	fn_scriptlog "Checking for update: teamspeak.com"
-	sleep 1
-	fn_printfail "Checking for update: teamspeak.com: Not returning version info"
-	fn_scriptlog "Failure! Checking for update: teamspeak.com: Not returning version info"
-	sleep 2
-	exit 1
-else
-	fn_printok "Checking for update: teamspeak.com"
-	fn_scriptlog "Success! Checking for update: teamspeak.com"
-	sleep 1
-fi
-
-# Removes dots so if can compare version numbers
-currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]')
-availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]')
-if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then
-	echo -e "\n"
-	echo -e "Update available:"
-	sleep 1
-	echo -e "	Current build: \e[0;31m${currentbuild} ${architecture}\e[0;39m"
-	echo -e "	Available build: \e[0;32m${availablebuild} ${architecture}\e[0;39m"
-	echo -e ""
-	sleep 1
-	echo ""
-	echo -en "Applying update.\r"
-	sleep 1
-	echo -en "Applying update..\r"
-	sleep 1
-	echo -en "Applying update...\r"
-	sleep 1
-	echo -en "\n"
-	fn_scriptlog "Update available"
-	fn_scriptlog "Current build: ${currentbuild}"
-	fn_scriptlog "Available build: ${availablebuild}"
-	fn_scriptlog "${currentbuild} > ${availablebuild}"
-	info_ts3status.sh
-	if [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
-		update_dl.sh
-		command_start.sh
-		sleep 5
-		command_stop.sh
-	else
-		command_stop.sh
-		update_dl.sh
-		command_start.sh
-	fi
-else
-	echo -e "\n"
-	echo -e "No update available:"
-	echo -e "	Current version: \e[0;32m${currentbuild}\e[0;39m"
-	echo -e "	Available version: \e[0;32m${availablebuild}\e[0;39m"
-	echo -e ""
-	fn_printoknl "No update available"
-	fn_scriptlog "Current build: ${currentbuild}"
-	fn_scriptlog "Available build: ${availablebuild}"
-fi
-}
-
-check.sh
-fn_printdots "Checking for update"
-if [ "${gamename}" == "Teamspeak 3" ]; then
-	fn_teamspeak3_check
-elif [ "${engine}" == "goldsource" ]||[ "${forceupdate}" == "1" ]; then
-	# Goldsource servers bypass checks as fn_steamcmdcheck does not work for appid 90 servers.
-	# forceupdate bypasses checks
-	tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
-	if [ "${tmuxwc}" -eq 1 ]; then
-		command_stop.sh
-		update_dl.sh
-		command_start.sh
-	else
-		update_dl.sh
-	fi
-else
-	fn_logupdaterequest
-	fn_steamcmdcheck
-fi

+ 0 - 83
functions/update_dl.sh

@@ -1,83 +0,0 @@
-#!/bin/bash
-# LGSM update_dl.sh function
-# Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="020216"
-
-# Description: Runs a server update.
-
-local modulename="Update"
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-fn_steamcmd_dl(){
-cd "${rootdir}"
-cd "steamcmd"
-
-# Detects if unbuffer command is available.
-if [ $(command -v unbuffer) ]; then
-	unbuffer=unbuffer
-fi
-
-if [ "${engine}" == "goldsource" ]; then
-	${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +quit|tee -a "${scriptlog}"
-else
-	${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit|tee -a "${scriptlog}"
-fi
-
-fix.sh
-}
-
-fn_teamspeak3_dl(){
-cd "${rootdir}"
-echo -e "downloading teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2...\c"
-fn_scriptlog "Downloading teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"
-wget -N /dev/null http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2 2>&1 | grep -F HTTP | cut -c45-| uniq
-sleep 1
-echo -e "extracting teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2...\c"
-fn_scriptlog "Extracting teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"
-tar -xf "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" 2> "${scriptlogdir}/.${servicename}-tar-error.tmp"
-local status=$?
-if [ ${status} -eq 0 ]; then
-	echo "OK"
-else
-	echo "FAIL - Exit status ${status}"
-	fn_scriptlog "Failed to extract - Exit status ${status}"
-	sleep 1
-	cat "${scriptlogdir}/.${servicename}-tar-error.tmp"
-	cat "${scriptlogdir}/.${servicename}-tar-error.tmp" >> "${scriptlog}"
-	rm "${scriptlogdir}/.${servicename}-tar-error.tmp"
-	fn_scriptlog "Failure! Unable to update"
-	exit ${status}
-fi
-echo -e "copying to ${filesdir}...\c"
-fn_scriptlog "Copying to ${filesdir}"
-cp -R "${rootdir}/teamspeak3-server_linux_${ts3arch}/"* "${filesdir}" 2> "${scriptlogdir}/.${servicename}-cp-error.tmp"
-local status=$?
-if [ ${status} -eq 0 ]; then
-	echo "OK"
-else
-	echo "FAIL - Exit status ${status}"
-	fn_scriptlog "Failed to copy - Exit status ${status}"
-	sleep 1
-	cat "${scriptlogdir}/.${servicename}-cp-error.tmp"
-	cat "${scriptlogdir}/.${servicename}-cp-error.tmp" >> "${scriptlog}"
-	rm "${scriptlogdir}/.${servicename}-cp-error.tmp"
-	fn_scriptlog "Failure! Unable to update"
-	exit ${status}
-fi
-rm -f teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2
-rm -rf "${rootdir}/teamspeak3-server_linux_${ts3arch}"
-}
-
-check.sh
-info_config.sh
-fn_printdots "Updating ${servername}"
-sleep 1
-fn_printoknl "Updating ${servername}"
-fn_scriptlog "Updating ${servername}"
-sleep 1
-if [ "${gamename}" == "Teamspeak 3" ]; then
-	fn_teamspeak3_dl
-else
-	fn_steamcmd_dl
-fi

+ 11 - 20
functions/update_functions.sh

@@ -1,24 +1,15 @@
 #!/bin/bash
-# LGSM update_functions.sh function
+# LGSM fn_update_functions function
 # Author: Daniel Gibbs
-# Website: http://gameservermanagers.com
-lgsm_version="230116"
+# Website: https://gameservermanagers.com
+lgsm_version="210516"
 
-# Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
+# Description: REDIRECT FUNCTION to new command_update_functions.sh
+
+command_update_functions.sh(){
+functionfile="${FUNCNAME}"
+fn_runfunction
+}
+
+command_update_functions.sh
 
-function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-check.sh
-fn_printdots "Updating functions"
-fn_scriptlog "Updating functions"
-sleep 1
-echo -ne "\n"
-rm -rfv "${rootdir}/functions/"*
-exitcode=$?
-if [ "${exitcode}" == "0" ]; then
-	fn_printok "Updating functions"
-	fn_scriptlog "Success! Updating functions"
-else
-	fn_printfail "Updating functions"
-	fn_scriptlog "Failure! Updating functions"
-fi
-echo -ne "\n"

BIN
images/screens/DST_menu.png


BIN
images/screens/DST_title.png


+ 0 - 0
functions/README.md → lgsm/functions/README.md


+ 61 - 0
lgsm/functions/alert.sh

@@ -0,0 +1,61 @@
+#!/bin/bash
+# LGSM alert.sh function
+# Author: Daniel Gibbs
+# Website: https://gameservermanagers.com
+lgsm_version="210516"
+
+# Description: Overall function for managing alerts.
+
+fn_alert_test(){
+	fn_scriptlog "Sending test alert"
+	alertsubject="LGSM - Test Alert - ${servername}"
+	alertbody="LGSM test alert, how you read?"
+}
+
+fn_alert_restart(){
+	fn_scriptlog "Sending restart alert: ${executable} process not running"
+	alertsubject="LGSM - Restarted - ${servername}"
+	alertbody="${servicename} ${executable} process not running"
+}
+
+fn_alert_restart_query(){
+	fn_scriptlog "Sending restart alert: ${gsquerycmd}"
+	alertsubject="LGSM - Restarted - ${servername}"
+	alertbody="gsquery.py failed to query: ${gsquerycmd}"
+}
+
+fn_alert_update(){
+	fn_scriptlog "Sending update alert"
+	alertsubject="LGSM - Updated - ${servername}"
+	alertbody="${servicename} recieved update"
+}
+
+if [ "${alert}" == "restart" ]; then
+	fn_alert_restart
+elif [ "${alert}" == "restartquery" ]; then
+	fn_alert_restart_query
+elif [ "${alert}" == "update" ]; then
+	fn_alert_update
+elif [ "${alert}" == "test" ]; then
+	fn_alert_test
+fi
+
+if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then
+	alert_email.sh
+elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+	fn_print_info_nl "Email alerts not enabled"
+	fn_scriptlog "Email alerts not enabled"
+elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+	fn_print_fail_nl "Email not set"
+	fn_scriptlog "Email not set"
+fi
+
+if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then
+	alert_pushbullet.sh
+elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+	fn_print_info_nl "Pushbullet alerts not enabled"
+	fn_scriptlog "Pushbullet alerts not enabled"
+elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+	fn_print_fail_nl "Pushbullet token not set"
+	fn_scriptlog "Pushbullet token not set"
+fi

+ 241 - 0
lgsm/functions/alert_email.sh

@@ -0,0 +1,241 @@
+#!/bin/bash
+# LGSM email.sh function
+# Author: Daniel Gibbs
+# Website: https://gameservermanagers.com
+lgsm_version="210516"
+
+# Description: Sends email alert if monitor picks up a failure.
+
+local modulename="Alert"
+
+
+fn_details_email(){
+	#
+	# Failure reason: Testing bb2-server email alert
+	# Action Taken: Sent test email...hello is this thing on?
+
+	echo -e "${alertbody}" >> "${emaillog}"
+}
+
+
+fn_details_os(){
+	#
+	# Distro Details
+	# =====================================
+	# Distro:    Ubuntu 14.04.4 LTS
+	# Arch:      x86_64
+	# Kernel:    3.13.0-79-generic
+	# Hostname:  hostname
+	# tmux:      tmux 1.8
+	# GLIBC:     2.19
+
+	{
+		echo -e ""
+		echo -e "Distro Details"
+		echo -e "================================="
+		echo -e "Distro: ${os}"
+		echo -e "Arch: ${arch}"
+		echo -e "Kernel: ${kernel}"
+		echo -e "Hostname: $HOSTNAME"
+		echo -e "tmux: ${tmuxv}"
+		echo -e "GLIBC: ${glibcversion}"
+	} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1
+}
+
+fn_details_performance(){
+	#
+	# Performance
+	# =====================================
+	# Uptime:    55d, 3h, 38m
+	# Avg Load:  1.00, 1.01, 0.78
+	#
+	# Mem:       total   used   free
+	# Physical:  741M    656M   85M
+	# Swap:      0B      0B     0B
+
+	{
+		echo -e ""
+		echo -e "Performance"
+		echo -e "================================="
+		echo -e "Uptime: ${days}d, ${hours}h, ${minutes}m"
+		echo -e "Avg Load: ${load}"
+		echo -e ""
+		echo -e "Mem: total  used  free"
+		echo -e "Physical: ${physmemtotal} ${physmemused} ${physmemfree}"
+		echo -e "Swap: ${swaptotal} ${swapused} ${swapfree}"
+	} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1
+}
+
+fn_details_disk(){
+	#
+	# Storage
+	# =====================================
+	# Filesystem:   /dev/disk/by-uuid/320c8edd-a2ce-4a23-8c9d-e00a7af2d6ff
+	# Total:        15G
+	# Used:         8.4G
+	# Available:    5.7G
+	# Serverfiles:  961M
+
+	{
+		echo -e ""
+		echo -e "Storage"
+		echo -e "================================="
+		echo -e "Filesystem: ${filesystem}"
+		echo -e "Total: ${totalspace}"
+		echo -e "Used: ${usedspace}"
+		echo -e "Available: ${availspace}"
+		echo -e "Serverfiles: ${filesdirdu}"
+		if [ -d "${backupdir}" ]; then
+			echo -e "Backups: ${backupdirdu}"
+		fi
+	} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1
+}
+
+
+
+fn_details_gameserver(){
+	#
+	# Quake Live Server Details
+	# =====================================
+	# Server name:      ql-server
+	# Server IP:        1.2.3.4:27960
+	# RCON password:    CHANGE_ME
+	# Server password:  NOT SET
+	# Slots:            16
+	# Status:           OFFLINE
+
+	{
+		echo -e ""
+		echo -e "${gamename} Server Details"
+		echo -e "================================="
+		# Server name
+		echo -e "Server name: ${servername}"
+
+		# Server ip
+		echo -e "Server IP: ${ip}:${port}"
+
+		# Server password
+		if [ -n "${serverpassword}" ]; then
+			echo -e "Server password: ********"
+		fi
+
+		# RCON password
+		if [ -n "${rconpassword}" ]; then
+			echo -e "RCON password: ********"
+		fi
+
+		# Admin password
+		if [ -n "${adminpassword}" ]; then
+			echo -e "Admin password: ********"
+		fi
+
+		# Stats password (Quake Live)
+		if [ -n "${statspassword}" ]; then
+			echo -e "Stats password: ********"
+		fi
+
+		# Slots
+		if [ -n "${slots}" ]; then
+			echo -e "Slots: ${slots}"
+		fi
+
+		# Game mode
+		if [ -n "${gamemode}" ]; then
+			echo -e "Game mode: ${gamemode}"
+		fi
+
+		# Game world
+		if [ -n "${gameworld}" ]; then
+			echo -e "Game world: ${gameworld}"
+		fi
+
+		# Tick rate
+		if [ -n "${tickrate}" ]; then
+			echo -e "Tick rate: ${tickrate}"
+		fi
+
+		# Teamspeak dbplugin
+		if [ -n "${dbplugin}" ]; then
+			echo -e "dbplugin: ${dbplugin}"
+		fi
+
+		# Online status
+		if [ "${status}" == "0" ]; then
+			echo -e "Status: OFFLINE"
+		else
+			echo -e "Status: ONLINE"
+		fi
+	} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1
+}
+
+fn_alert_email_template_logs(){
+	{
+	echo -e ""
+	echo -e "${servicename} Logs"
+	echo -e "================================="
+
+	if [ -n "${scriptlog}" ]; then
+		echo -e "\nScript log\n==================="
+		if [ ! "$(ls -A ${scriptlogdir})" ]; then
+			echo "${scriptlogdir} (NO LOG FILES)"
+		elif [ ! -s "${scriptlog}" ]; then
+			echo "${scriptlog} (LOG FILE IS EMPTY)"
+		else
+			echo "${scriptlog}"
+			tail -25 "${scriptlog}"
+		fi
+		echo ""
+	fi
+
+	if [ -n "${consolelog}" ]; then
+		echo -e "\nConsole log\n===================="
+		if [ ! "$(ls -A ${consolelogdir})" ]; then
+			echo "${consolelogdir} (NO LOG FILES)"
+		elif [ ! -s "${consolelog}" ]; then
+			echo "${consolelog} (LOG FILE IS EMPTY)"
+		else
+			echo "${consolelog}"
+			tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }'
+		fi
+		echo ""
+	fi
+
+	if [ -n "${gamelogdir}" ]; then
+		echo -e "\nServer log\n==================="
+		if [ ! "$(ls -A ${gamelogdir})" ]; then
+			echo "${gamelogdir} (NO LOG FILES)"
+		else
+			echo "${gamelogdir}"
+			tail "${gamelogdir}"/* | grep -v "==>" | sed '/^$/d' | tail -25
+		fi
+		echo ""
+	fi
+
+	} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1
+}
+
+fn_print_dots "Sending alert to ${email}"
+info_distro.sh
+info_config.sh
+info_glibc.sh
+check_ip.sh
+
+emaillog="${emaillog}"
+if [ -f "${emaillog}" ]; then
+	rm "${emaillog}"
+fi
+fn_details_email
+fn_details_os
+fn_details_performance
+fn_details_disk
+fn_details_gameserver
+fn_alert_email_template_logs
+mail -s "${alertsubject}" "${email}" < "${emaillog}"
+exitcode=$?
+if [ "${exitcode}" == "0" ]; then
+	fn_print_ok_nl "Sending alert to ${email}"
+	fn_scriptlog "Success! Sending alert to ${email}"
+else
+	fn_print_fail_nl "Sending alert to ${email}"
+	fn_scriptlog "Failure! Sending alert to ${email}"
+fi

+ 22 - 0
lgsm/functions/alert_pushbullet.sh

@@ -0,0 +1,22 @@
+#!/bin/bash
+# LGSM alert_pushbullet.sh function
+# Author: Daniel Gibbs
+# Website: https://gameservermanagers.com
+lgsm_version="210516"
+
+# Description: alerts using pushbullet.
+
+local modulename="Alert"
+function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+fn_print_dots "Sending Pushbullet alert"
+sleep 1
+
+pushbulletsend=$(curl --silent -u """${pushbullettoken}"":" -d type="note" -d body="${alertbody}" -d title="${alertsubject}" 'https://api.pushbullet.com/v2/pushes'|grep -o invalid_access_token|uniq)
+
+if [ "${pushbulletsend}" == "invalid_access_token" ]; then
+	fn_print_fail_nl "Sending Pushbullet alert: invalid_access_token"
+	fn_scriptlog "Failure! Sending Pushbullet alert: invalid_access_token"
+else
+	fn_print_ok_nl "Sending Pushbullet alert"
+	fn_scriptlog "Complete! Sent Pushbullet alert"
+fi

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.