Răsfoiți Sursa

updated fn_scriptlog to fn_script_log

Bringing in line with other function names
Daniel Gibbs 10 ani în urmă
părinte
comite
adfbaa49f3

+ 3 - 3
functions/command_update_functions.sh

@@ -9,7 +9,7 @@ lgsm_version="210516"
 function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 check.sh
 fn_print_dots "Updating functions"
-fn_scriptlog "Updating functions"
+fn_script_log "Updating functions"
 sleep 1
 echo -ne "\n"
 
@@ -30,9 +30,9 @@ fi
 
 if [ "${exitcode}" == "0" ]; then
 	fn_print_ok "Updating functions"
-	fn_scriptlog "Success! Updating functions"
+	fn_script_log "Success! Updating functions"
 else
 	fn_print_fail "Updating functions"
-	fn_scriptlog "Failure! Updating functions"
+	fn_script_log "Failure! Updating functions"
 fi
 echo -ne "\n"

+ 8 - 8
lgsm/functions/alert.sh

@@ -7,25 +7,25 @@ lgsm_version="210516"
 # Description: Overall function for managing alerts.
 
 fn_alert_test(){
-	fn_scriptlog "Sending test alert"
+	fn_script_log "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"
+	fn_script_log "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}"
+	fn_script_log "Sending restart alert: ${gsquerycmd}"
 	alertsubject="LGSM - Restarted - ${servername}"
 	alertbody="gsquery.py failed to query: ${gsquerycmd}"
 }
 
 fn_alert_update(){
-	fn_scriptlog "Sending update alert"
+	fn_script_log "Sending update alert"
 	alertsubject="LGSM - Updated - ${servername}"
 	alertbody="${servicename} recieved update"
 }
@@ -44,18 +44,18 @@ if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${emai
 	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"
+	fn_script_log "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"
+	fn_script_log "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"
+	fn_script_log "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"
+	fn_script_log "Pushbullet token not set"
 fi

+ 2 - 2
lgsm/functions/alert_email.sh

@@ -234,8 +234,8 @@ 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}"
+	fn_script_log "Success! Sending alert to ${email}"
 else
 	fn_print_fail_nl "Sending alert to ${email}"
-	fn_scriptlog "Failure! Sending alert to ${email}"
+	fn_script_log "Failure! Sending alert to ${email}"
 fi

+ 2 - 2
lgsm/functions/alert_pushbullet.sh

@@ -15,8 +15,8 @@ pushbulletsend=$(curl --silent -u """${pushbullettoken}"":" -d type="note" -d bo
 
 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"
+	fn_script_log "Failure! Sending Pushbullet alert: invalid_access_token"
 else
 	fn_print_ok_nl "Sending Pushbullet alert"
-	fn_scriptlog "Complete! Sent Pushbullet alert"
+	fn_script_log "Complete! Sent Pushbullet alert"
 fi

+ 2 - 2
lgsm/functions/check_config.sh

@@ -10,8 +10,8 @@ if [ ! -e "${servercfgfullpath}" ]; then
 	if [ "${gamename}" != "Hurtworld" ]; then
 		fn_print_warn_nl "Config file missing!"
 		echo "${servercfgfullpath}"
-		fn_scriptlog "Configuration file missing!"
-		fn_scriptlog "${servercfgfullpath}"
+		fn_script_log "Configuration file missing!"
+		fn_script_log "${servercfgfullpath}"
 		sleep 2
 	fi
 fi

+ 2 - 2
lgsm/functions/check_deps.sh

@@ -65,7 +65,7 @@ fn_found_missing_deps(){
 		fn_print_dots "Checking dependencies"
 		sleep 2
 		fn_print_warn "Checking dependencies: missing: \e[0;31m${array_deps_missing[@]}\e[0m"
-		fn_scriptlog "Checking dependencies: missing: \e[0;31m${array_deps_missing[@]}\e[0m"
+		fn_script_log "Checking dependencies: missing: \e[0;31m${array_deps_missing[@]}\e[0m"
 		sleep 1
 		echo -e ""
 		sudo -n true > /dev/null 2>&1
@@ -86,7 +86,7 @@ fn_found_missing_deps(){
 		else
 			echo ""
 			fn_print_infomation_nl "$(whoami) does not have sudo access. Please manually install dependencies"
-			fn_scriptlog "$(whoami) does not have sudo access. Please manually install dependencies"
+			fn_script_log "$(whoami) does not have sudo access. Please manually install dependencies"
 			echo ""
 			if [ -n "$(command -v dpkg-query)" ]; then
 				echo "sudo dpkg --add-architecture i386; sudo apt-get install ${array_deps_missing[@]}"

+ 1 - 1
lgsm/functions/check_root.sh

@@ -7,7 +7,7 @@ lgsm_version="210516"
 if [ $(whoami) = "root" ]; then
 	fn_print_fail_nl "Do NOT run this script as root!"
 	if [ -d "${scriptlogdir}" ]; then
-		fn_scriptlog "${selfname} attempted to run as root."
+		fn_script_log "${selfname} attempted to run as root."
 	fi
 	exit 1
 fi

+ 3 - 3
lgsm/functions/check_steamcmd.sh

@@ -23,7 +23,7 @@ fn_check_steamcmd_user(){
 		fn_print_fail_nl "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."
+			fn_script_log "edit ${selfname}. change steamuser=\"username\" to a valid steam login."
 			exit 1
 		fi
 	fi
@@ -31,7 +31,7 @@ fn_check_steamcmd_user(){
 	if [ -z "${steamuser}" ]; then
 		fn_print_warn_nl "Steam login not set. Using anonymous login."
 		if [ -d "${scriptlogdir}" ]; then
-			fn_scriptlog "Steam login not set. Using anonymous login."
+			fn_script_log "Steam login not set. Using anonymous login."
 		fi
 		steamuser="anonymous"
 		steampass=""
@@ -48,7 +48,7 @@ fn_check_steamcmd_sh(){
 			fn_install_steamcmd
 		else
 			fn_print_warn_nl "SteamCMD is missing"
-			fn_scriptlog "SteamCMD is missing"
+			fn_script_log "SteamCMD is missing"
 			sleep 1
 			fn_install_steamcmd
 		fi

+ 1 - 1
lgsm/functions/check_system_dir.sh

@@ -7,7 +7,7 @@ lgsm_version="210516"
 if [ ! -d "${systemdir}" ]; then
 	fn_print_fail_nl "Cannot access ${systemdir}: No such directory"
 	if [ -d "${scriptlogdir}" ]; then
-		fn_scriptlog "Cannot access ${systemdir}: No such directory."
+		fn_script_log "Cannot access ${systemdir}: No such directory."
 	fi
 	exit 1
 fi

+ 1 - 1
lgsm/functions/check_tmux.sh

@@ -11,7 +11,7 @@ if [ "$(command -v tmux)" ]||[ "$(which tmux >/dev/null 2>&1)" ]||[ -f "/usr/bin
 else
 	fn_print_fail_nl "Tmux not installed"
 	sleep 1
-	fn_scriptlog "Tmux is not installed"
+	fn_script_log "Tmux is not installed"
 	echo "	* Tmux is required to run this server."
 	# Suitable passive agressive message
 	echo "	* Please see the the following link."

+ 2 - 2
lgsm/functions/command_backup.sh

@@ -38,7 +38,7 @@ if [ "${status}" != "0" ]; then
 	esac
 	done
 fi
-fn_scriptlog "Started backup"
+fn_script_log "Started backup"
 fn_print_dots "Backup in progress, please wait..."
 sleep 2
 if [ ! -d "${backupdir}" ]; then
@@ -46,6 +46,6 @@ if [ ! -d "${backupdir}" ]; then
 fi
 tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "backups" ./*
 fn_print_ok_nl "Backup created: ${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
-fn_scriptlog "Complete, Backup created: ${backupdir}/${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
+fn_script_log "Complete, Backup created: ${backupdir}/${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
 sleep 1
 echo ""

+ 2 - 2
lgsm/functions/command_console.sh

@@ -30,12 +30,12 @@ sleep 1
 check_status.sh
 if [ "${status}" != "0" ]; then
 	fn_print_ok_nl "Starting"
-	fn_scriptlog "accessed"
+	fn_script_log "accessed"
 	sleep 1
 	tmux attach-session -t ${servicename}
 else
 	fn_print_fail_nl "Server not running"
-	fn_scriptlog "Failed to access: Server not running"
+	fn_script_log "Failed to access: Server not running"
 	sleep 1
 	while true; do
 		read -p "Do you want to start the server? [y/N]" yn

+ 3 - 3
lgsm/functions/command_debug.sh

@@ -41,15 +41,15 @@ while true; do
 	* ) echo "Please answer yes or no.";;
 esac
 done
-fn_scriptlog "Starting debug"
+fn_script_log "Starting debug"
 fn_print_info_nl "Stopping any running servers"
-fn_scriptlog "Stopping any running servers"
+fn_script_log "Stopping any running servers"
 sleep 1
 command_stop.sh
 fn_print_dots "Starting debug"
 sleep 1
 fn_print_ok_nl "Starting debug"
-fn_scriptlog "Started debug"
+fn_script_log "Started debug"
 cd "${executabledir}"
 fix.sh
 if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then

+ 29 - 29
lgsm/functions/command_fastdl.sh

@@ -26,7 +26,7 @@ fn_check_bzip2(){
 	if [ -z "$(command -v bzip2)" ]; then
 		bzip2installed="0"
 		fn_print_info "bzip2 is not installed !"
-		fn_scriptlog "bzip2 is not installed"
+		fn_script_log "bzip2 is not installed"
 		echo -en "\n"
 		sleep 1
 		echo "We advise using it"
@@ -42,7 +42,7 @@ fn_fastdl_init(){
 	fn_print_ok "Welcome to LGSM's FastDL generator"
 	sleep 1
 	echo -en "\n"
-	fn_scriptlog "Started FastDL creation"
+	fn_script_log "Started FastDL creation"
 	while true; do
 		read -e -i "y" -p "Continue? [Y/n]" yn
 		case $yn in
@@ -51,7 +51,7 @@ fn_fastdl_init(){
 		* ) echo "Please answer yes or no.";;
 		esac
 	done
-	fn_scriptlog "Initiating FastDL creation"
+	fn_script_log "Initiating FastDL creation"
 
 	# Check and create folders
 	if [ ! -d "${webdir}" ]; then
@@ -63,7 +63,7 @@ fn_fastdl_init(){
 		sleep 0.5
 		mkdir "${webdir}"
 		fn_print_ok "Created www directory"
-		fn_scriptlog "FastDL created www directory"
+		fn_script_log "FastDL created www directory"
 		sleep 1
 		echo -en "\n"
 	fi
@@ -74,7 +74,7 @@ fn_fastdl_init(){
 		sleep 0.5
 		mkdir "${fastdldir}"
 		fn_print_ok "Created fastdl directory"
-		fn_scriptlog "FastDL created fastdl directory"
+		fn_script_log "FastDL created fastdl directory"
 		sleep 1
 		echo -en "\n"
 		clearoldfastdl="off" # Nothing to clear
@@ -86,7 +86,7 @@ fn_fastdl_init(){
 fn_fastdl_config(){
 	# Global settings for FastDL creation
 	fn_print_info "Entering configuration"
-	fn_scriptlog "Configuration"
+	fn_script_log "Configuration"
 	sleep 2
 	echo -en "\n"
 	# Prompt for clearing old files if folder was already here
@@ -95,8 +95,8 @@ fn_fastdl_config(){
 		while true; do
 			read -e -i "y" -p "Clear old FastDL files? [Y/n]" yn
 			case $yn in
-			[Yy]* ) clearoldfastdl="on"; fn_scriptlog "clearoldfastdl enabled"; fn_print_ok "Clearing Enabled"; break;;
-			[Nn]* ) clearoldfastdl="off"; fn_scriptlog "clearoldfastdl disabled"; fn_print_ok "Clearing Disabled"; break;;
+			[Yy]* ) clearoldfastdl="on"; fn_script_log "clearoldfastdl enabled"; fn_print_ok "Clearing Enabled"; break;;
+			[Nn]* ) clearoldfastdl="off"; fn_script_log "clearoldfastdl disabled"; fn_print_ok "Clearing Disabled"; break;;
 			* ) echo "Please answer yes or no.";;
 			esac
 		done
@@ -108,8 +108,8 @@ fn_fastdl_config(){
 		while true; do
 			read -e -i "y" -p "Enable file compression using bzip2? [Y/n]" yn
 			case $yn in
-			[Yy]* ) bzip2enable="on"; fn_scriptlog "bzip2 enabled"; fn_print_ok "bzip2 Enabled"; break;;
-			[Nn]* ) bzip2enable="off"; fn_scriptlog "bzip2 disabled"; fn_print_ok "bzip2 Disabled"; break;;
+			[Yy]* ) bzip2enable="on"; fn_script_log "bzip2 enabled"; fn_print_ok "bzip2 Enabled"; break;;
+			[Nn]* ) bzip2enable="off"; fn_script_log "bzip2 disabled"; fn_print_ok "bzip2 Disabled"; break;;
 			* ) echo "Please answer yes or no.";;
 			esac
 		done
@@ -123,8 +123,8 @@ fn_fastdl_gmod_config(){
 	while true; do
 		read -e -i "y" -p "Use client download enforcer? [Y/n]" yn
 		case $yn in
-		[Yy]* ) luaressource="on"; fn_scriptlog "DL enforcer Enabled"; fn_print_ok "Enforcer Enabled"; break;;
-		[Nn]* ) luaressource="off"; fn_scriptlog "DL enforcer Disabled"; fn_print_ok "Enforcer Disabled"; break;;
+		[Yy]* ) luaressource="on"; fn_script_log "DL enforcer Enabled"; fn_print_ok "Enforcer Enabled"; break;;
+		[Nn]* ) luaressource="off"; fn_script_log "DL enforcer Disabled"; fn_print_ok "Enforcer Disabled"; break;;
 		* ) echo "Please answer yes or no.";;
 		esac
 	done
@@ -135,11 +135,11 @@ fn_clear_old_fastdl(){
 	# Clearing old FastDL if user answered yes
 	if [ "${clearoldfastdl}" == "on" ]; then
 		fn_print_info "Clearing existing FastDL folder"
-		fn_scriptlog "Clearing existing FastDL folder"
+		fn_script_log "Clearing existing FastDL folder"
 		sleep 0.5
 		rm -R "${fastdldir:?}"/*
 		fn_print_ok "Old FastDL folder cleared"
-		fn_scriptlog "Old FastDL folder cleared"
+		fn_script_log "Old FastDL folder cleared"
 		sleep 1
 		echo -en "\n"
 	fi
@@ -149,7 +149,7 @@ fn_gmod_fastdl(){
 	# Copy all needed files for FastDL
 	echo ""
 	fn_print_dots "Starting gathering all needed files"
-	fn_scriptlog "Starting gathering all needed files"
+	fn_script_log "Starting gathering all needed files"
 	sleep 1
 	echo -en "\n"
 
@@ -158,7 +158,7 @@ fn_gmod_fastdl(){
 
 	# Map Files
 	fn_print_dots "Copying map files..."
-	fn_scriptlog "Copying map files"
+	fn_script_log "Copying map files"
 	sleep 0.5
 	find . -name '*.bsp' | cpio --quiet -updm "${fastdldir}"
 	fn_print_ok "Map files copied"
@@ -167,7 +167,7 @@ fn_gmod_fastdl(){
 
 	# Materials
 	fn_print_dots "Copying materials..."
-	fn_scriptlog "Copying materials"
+	fn_script_log "Copying materials"
 	sleep 0.5
 	find . -name '*.vtf' | cpio --quiet -updm "${fastdldir}"
 	find . -name '*.vmt' | cpio --quiet -updm "${fastdldir}"
@@ -177,7 +177,7 @@ fn_gmod_fastdl(){
 
 	# Models
 	fn_print_dots "Copying models..."
-	fn_scriptlog "Copying models"
+	fn_script_log "Copying models"
 	sleep 1
 	find . -name '*.vtx' | cpio --quiet -updm "${fastdldir}"
 	find . -name '*.vvd' | cpio --quiet -updm "${fastdldir}"
@@ -189,7 +189,7 @@ fn_gmod_fastdl(){
 
 	# Particles
 	fn_print_dots "Copying particles..."
-	fn_scriptlog "Copying particles"
+	fn_script_log "Copying particles"
 	sleep 0.5
 	find . -name '*.pcf' | cpio --quiet -updm "${fastdldir}"
 	fn_print_ok "Particles copied"
@@ -198,7 +198,7 @@ fn_gmod_fastdl(){
 
 	# Sounds
 	fn_print_dots "Copying sounds..."
-	fn_scriptlog "Copying sounds"
+	fn_script_log "Copying sounds"
 	sleep 0.5
 	find . -name '*.wav' | cpio --quiet -updm "${fastdldir}"
 	find . -name '*.mp3' | cpio --quiet -updm "${fastdldir}"
@@ -209,7 +209,7 @@ fn_gmod_fastdl(){
 
 	# Resources (mostly fonts)
 	fn_print_dots "Copying fonts and png..."
-	fn_scriptlog "Copying fonts and png"
+	fn_script_log "Copying fonts and png"
 	sleep 1
 	find . -name '*.otf' | cpio --quiet -updm "${fastdldir}"
 	find . -name '*.ttf' | cpio --quiet -updm "${fastdldir}"
@@ -224,7 +224,7 @@ fn_gmod_fastdl(){
 	# Correct addons folder structure for FastDL
 	if [ -d "${fastdldir}/addons" ]; then
 		fn_print_info "Adjusting addons' file structure"
-		fn_scriptlog "Adjusting addon's file structure"
+		fn_script_log "Adjusting addon's file structure"
 		sleep 1
 		cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}"
 	#Don't remove yet	rm -R "${fastdldir:?}/addons"
@@ -254,7 +254,7 @@ fn_lua_fastdl(){
 			sleep 1
 			rm -R "${luafastdlfullpath:?}"
 			fn_print_ok "Removed download enforcer"
-			fn_scriptlog "Removed old download inforcer"
+			fn_script_log "Removed old download inforcer"
 			echo -en "\n"
 			sleep 2
 		fi
@@ -266,19 +266,19 @@ fn_lua_fastdl(){
 			sleep 1
 			rm "${luafastdlfullpath}"
 			fn_print_ok "Removed old download enforcer"
-			fn_scriptlog "Removed old download enforcer"
+			fn_script_log "Removed old download enforcer"
 			echo -en "\n"
 			sleep 1
 		fi
 		fn_print_dots "Generating new download enforcer"
-		fn_scriptlog "Generating new download enforcer"
+		fn_script_log "Generating new download enforcer"
 		sleep 1
 		# Read all filenames and put them into a lua file at the right path
 		find "${fastdldir}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do
 			echo "resource.AddFile( "\""${line}"\"" )" >> ${luafastdlfullpath}
 		done
 		fn_print_ok "Download enforcer generated"
-		fn_scriptlog "Download enforcer generated"
+		fn_script_log "Download enforcer generated"
 		echo -en "\n"
 		echo ""
 		sleep 2
@@ -293,11 +293,11 @@ fn_fastdl_bzip2(){
 		echo -en "\n"
 		echo ""
 		fn_print_dots "Compressing files using bzip2..."
-		fn_scriptlog "Compressing files using bzip2..."
+		fn_script_log "Compressing files using bzip2..."
 		# bzip2 all files that are not already compressed (keeping original files)
 		find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec bzip2 -qk \{\} \;
 		fn_print_ok "bzip2 compression done"
-		fn_scriptlog "bzip2 compression done"
+		fn_script_log "bzip2 compression done"
 		sleep 1
 		echo -en "\n"
 	fi
@@ -307,7 +307,7 @@ fn_fastdl_completed(){
 	# Finished message
 	echo ""
 	fn_print_ok "Congratulations, it's done !"
-	fn_scriptlog "FastDL job done"
+	fn_script_log "FastDL job done"
 	sleep 2
 	echo -en "\n"
 	echo ""

+ 10 - 10
lgsm/functions/command_monitor.sh

@@ -14,7 +14,7 @@ fn_monitor_check_lockfile(){
 	# Monitor does not run it lockfile is not found
 	if [ ! -f "${rootdir}/${lockselfname}" ]; then
 		fn_print_info_nl "Disabled: No lock file found"
-		fn_scriptlog "Disabled: No lock file found"
+		fn_script_log "Disabled: No lock file found"
 		echo "	* To enable monitor run ./${selfname} start"
 		exit 1
 	fi
@@ -24,7 +24,7 @@ fn_monitor_check_update(){
 	# Monitor will not check if update is running.
 	if [ "$(ps -ef|grep "${selfname} update"|grep -v grep|wc -l)" != "0" ]; then
 		fn_print_info_nl "SteamCMD is currently checking for updates"
-		fn_scriptlog "SteamCMD is currently checking for updates"
+		fn_script_log "SteamCMD is currently checking for updates"
 		sleep 1
 		exit
 	fi
@@ -33,7 +33,7 @@ fn_monitor_check_update(){
 fn_monitor_msg_checking(){
 	fn_print_dots "Checking session: "
 	fn_print_checking_eol
-	fn_scriptlog "Checking session: CHECKING"
+	fn_script_log "Checking session: CHECKING"
 	sleep 1
 }
 
@@ -41,17 +41,17 @@ fn_monitor_teamspeak3(){
 	if [ "${status}" != "0" ]; then
 		fn_print_ok "Checking session: "
 		fn_print_ok_eol_nl
-		fn_scriptlog "Checking session: OK"
+		fn_script_log "Checking session: OK"
 		exit
 	else
 		fn_print_fail "Checking session: ${ts3error}: "
 		fn_print_fail_eol_nl
-		fn_scriptlog "Checking session: ${ts3error}: FAIL"
+		fn_script_log "Checking session: ${ts3error}: FAIL"
 		failurereason="${ts3error}"
 		alert="restart"
 		alert.sh
 	fi
-	fn_scriptlog "Monitor is starting ${servername}"
+	fn_script_log "Monitor is starting ${servername}"
 	sleep 1
 	fn_restart
 }
@@ -61,7 +61,7 @@ fn_monitor_tmux(){
 	if [ "${status}" != "0" ]; then
 		fn_print_ok "Checking session: "
 		fn_print_ok_eol_nl
-		fn_scriptlog "Checking session: OK"
+		fn_script_log "Checking session: OK"
 		# runs gsquery check on game with specific engines.
 		local allowed_engines_array=( avalanche goldsource realvirtuality source spark unity3d unreal unreal2 )
 		for allowed_engine in "${allowed_engines_array[@]}"
@@ -74,10 +74,10 @@ fn_monitor_tmux(){
 	else
 		fn_print_fail "Checking session: "
 		fn_print_fail_eol_nl
-		fn_scriptlog "Checking session: FAIL"
+		fn_script_log "Checking session: FAIL"
 		alert="restart"
 		alert.sh
-		fn_scriptlog "Monitor is starting ${servername}"
+		fn_script_log "Monitor is starting ${servername}"
 		sleep 1
 		command_start.sh
 	fi
@@ -87,7 +87,7 @@ check.sh
 logs.sh
 info_config.sh
 fn_print_dots "${servername}"
-fn_scriptlog "${servername}"
+fn_script_log "${servername}"
 sleep 1
 fn_monitor_check_lockfile
 fn_monitor_check_update

+ 20 - 20
lgsm/functions/command_start.sh

@@ -12,26 +12,26 @@ function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 fn_start_teamspeak3(){
 	if [ ! -e "${servercfgfullpath}" ]; then
 		fn_print_warn_nl "${servercfgfullpath} is missing"
-		fn_scriptlog "${servercfgfullpath} is missing"
+		fn_script_log "${servercfgfullpath} is missing"
 		echo  "	* Creating blank ${servercfg}"
-		fn_scriptlog "Creating blank ${servercfg}"
+		fn_script_log "Creating blank ${servercfg}"
 		sleep 2
 		echo  "	* ${servercfg} can remain blank by default."
-		fn_scriptlog "${servercfgfullpath} can remain blank by default."
+		fn_script_log "${servercfgfullpath} can remain blank by default."
 		sleep 2
 		echo  "	* ${servercfg} is located in ${servercfgfullpath}."
-		fn_scriptlog "${servercfg} is located in ${servercfgfullpath}."
+		fn_script_log "${servercfg} is located in ${servercfgfullpath}."
 		sleep 5
 		touch "${servercfgfullpath}"
 	fi
 
 	fn_print_dots "${servername}"
-	fn_scriptlog "${servername}"
+	fn_script_log "${servername}"
 	sleep 1
 	check_status.sh
 	if [ "${status}" != "0" ]; then
 		fn_print_info_nl "${servername} is already running"
-		fn_scriptlog "${servername} is already running"
+		fn_script_log "${servername} is already running"
 		exit
 	fi
 
@@ -48,25 +48,25 @@ fn_start_teamspeak3(){
 	check_status.sh
 	if [ "${status}" == "0" ]; then
 		fn_print_fail_nl "Unable to start ${servername}"
-		fn_scriptlog "Unable to start ${servername}"
+		fn_script_log "Unable to start ${servername}"
 		echo -e "	Check log files: ${rootdir}/log"
 		exit 1
 	else
 		fn_print_ok_nl "${servername}"
-		fn_scriptlog "Started ${servername}"
+		fn_script_log "Started ${servername}"
 	fi
 }
 
 fn_start_tmux(){
 	fn_parms
 	fn_print_dots "${servername}"
-	fn_scriptlog "${servername}"
+	fn_script_log "${servername}"
 	sleep 1
 
 	# Log rotation
 	check_status.sh
 	if [ "${status}" == "0" ]; then
-		fn_scriptlog "Rotating log files"
+		fn_script_log "Rotating log files"
 		if [ "${engine}" == "unreal2" ]; then
 			if [ -f "${gamelog}" ]; then
 				mv "${gamelog}" "${gamelogdate}"
@@ -80,7 +80,7 @@ fn_start_tmux(){
 	check_status.sh
 	if [ "${status}" != "0" ]; then
 		fn_print_info_nl "${servername} is already running"
-		fn_scriptlog "${servername} is already running"
+		fn_script_log "${servername} is already running"
 		exit
 	fi
 
@@ -110,7 +110,7 @@ fn_start_tmux(){
 	elif [ "${consolelogging}" == "off" ]; then
 		touch "${consolelog}"
 		cat "Console logging disabled by user" >> "{consolelog}"
-		fn_scriptlog "Console logging disabled by user"
+		fn_script_log "Console logging disabled by user"
 	fi
 	sleep 1
 
@@ -118,11 +118,11 @@ fn_start_tmux(){
 	check_status.sh
 	if [ "${status}" == "0" ]; then
 		fn_print_fail_nl "Unable to start ${servername}"
-		fn_scriptlog "Unable to start ${servername}"
+		fn_script_log "Unable to start ${servername}"
 		sleep 1
 		if [ -s "${scriptlogdir}/.${servicename}-tmux-error.tmp" ]; then
 			fn_print_fail_nl "Unable to start ${servername}: Tmux error:"
-			fn_scriptlog "Tmux error"
+			fn_script_log "Tmux error"
 			echo ""
 			echo "Command"
 			echo "================================="
@@ -139,30 +139,30 @@ fn_start_tmux(){
 			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."
+					fn_script_log "$(whoami) is not part of the tty group."
 					group=$(grep tty /etc/group)
 					echo ""
 					echo "	${group}"
-					fn_scriptlog "${group}"
+					fn_script_log "${group}"
 					echo ""
 					echo "Run the following command with root privileges."
 					echo ""
 					echo "	usermod -G tty $(whoami)"
 					echo ""
 					echo "https://gameservermanagers.com/tmux-op-perm"
-					fn_scriptlog "https://gameservermanagers.com/tmux-op-perm"
+					fn_script_log "https://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."
+					fn_script_log "No known fix currently. Please log an issue."
 					echo "https://gameservermanagers.com/issues"
-					fn_scriptlog "https://gameservermanagers.com/issues"
+					fn_script_log "https://gameservermanagers.com/issues"
 				fi
 			fi
 		fi
 	exit 1
 	else
 		fn_print_ok "${servername}"
-		fn_scriptlog "Started ${servername}"
+		fn_script_log "Started ${servername}"
 	fi
 	rm "${scriptlogdir}/.${servicename}-tmux-error.tmp"
 	echo -en "\n"

+ 22 - 22
lgsm/functions/command_stop.sh

@@ -12,7 +12,7 @@ function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 # Attempts Graceful of source using rcon 'quit' command.
 fn_stop_graceful_source(){
 	fn_print_dots "Graceful: rcon quit"
-	fn_scriptlog "Graceful: rcon quit"
+	fn_script_log "Graceful: rcon quit"
 	# sends quit
 	tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1
 	# waits up to 30 seconds giving the server time to shutdown gracefuly
@@ -21,7 +21,7 @@ fn_stop_graceful_source(){
 		if [ "${status}" == "0" ]; then
 			fn_print_ok "Graceful: rcon quit: ${seconds}: "
 			fn_print_ok_eol_nl
-			fn_scriptlog "Graceful: rcon quit: OK: ${seconds} seconds"
+			fn_script_log "Graceful: rcon quit: OK: ${seconds} seconds"
 			break
 		fi
 		sleep 1
@@ -31,7 +31,7 @@ fn_stop_graceful_source(){
 	if [ "${status}" != "0" ]; then
 		fn_print_fail "Graceful: rcon quit: "
 		fn_print_fail_eol_nl
-		fn_scriptlog "Graceful: rcon quit: FAIL"
+		fn_script_log "Graceful: rcon quit: FAIL"
 	fi
 	sleep 1
 	fn_stop_tmux
@@ -43,7 +43,7 @@ fn_stop_graceful_source(){
 # preventing the server from coming back online.
 fn_stop_graceful_goldsource(){
 	fn_print_dots "Graceful: rcon quit"
-	fn_scriptlog "Graceful: rcon quit"
+	fn_script_log "Graceful: rcon quit"
 	# sends quit
 	tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1
 	# waits 3 seconds as goldsource servers restart with the quit command
@@ -53,7 +53,7 @@ fn_stop_graceful_goldsource(){
 	done
 	fn_print_ok "Graceful: rcon quit: ${seconds}: "
 	fn_print_ok_eol_nl
-	fn_scriptlog "Graceful: rcon quit: OK: ${seconds} seconds"
+	fn_script_log "Graceful: rcon quit: OK: ${seconds} seconds"
 	sleep 1
 	fn_stop_tmux
 }
@@ -82,7 +82,7 @@ fn_stop_telnet_sdtd(){
 
 fn_stop_graceful_sdtd(){
 	fn_print_dots "Graceful: telnet"
-	fn_scriptlog "Graceful: telnet"
+	fn_script_log "Graceful: telnet"
 	sleep 1
 	if [ "${telnetenabled}" == "false" ]; then
 		fn_print_info_nl "Graceful: telnet: DISABLED: Enable in ${servercfg}"
@@ -90,7 +90,7 @@ fn_stop_graceful_sdtd(){
 		# Tries to shutdown with both localhost and server IP.
 		for telnetip in 127.0.0.1 ${ip}; do
 			fn_print_dots "Graceful: telnet: ${telnetip}"
-			fn_scriptlog "Graceful: telnet: ${telnetip}"
+			fn_script_log "Graceful: telnet: ${telnetip}"
 			sleep 1
 			fn_stop_telnet_sdtd
 			completed=$(echo -en "\n ${sdtd_telnet_shutdown}"|grep "Completed.")
@@ -98,7 +98,7 @@ fn_stop_graceful_sdtd(){
 			if [ -n "${refused}" ]; then
 				fn_print_warn "Graceful: telnet: ${telnetip}: "
 				fn_print_fail_eol_nl
-				fn_scriptlog "Graceful: telnet: ${telnetip}: FAIL"
+				fn_script_log "Graceful: telnet: ${telnetip}: FAIL"
 				sleep 1
 			elif [ -n "${completed}" ]; then
 				break
@@ -114,7 +114,7 @@ fn_stop_graceful_sdtd(){
 				if [ -n "${refused}" ]; then
 					fn_print_ok "Graceful: telnet: ${telnetip}: "
 					fn_print_ok_eol_nl
-					fn_scriptlog "Graceful: telnet: ${telnetip}: ${seconds} seconds"
+					fn_script_log "Graceful: telnet: ${telnetip}: ${seconds} seconds"
 					break
 				fi
 				sleep 1
@@ -126,10 +126,10 @@ fn_stop_graceful_sdtd(){
 			if [ -n "${refused}" ]; then
 				fn_print_fail "Graceful: telnet: "
 				fn_print_fail_eol_nl
-				fn_scriptlog "Graceful: telnet: ${telnetip}: FAIL"
+				fn_script_log "Graceful: telnet: ${telnetip}: FAIL"
 			else
 				fn_print_fail_nl "Graceful: telnet: Unknown error"
-				fn_scriptlog "Graceful: telnet: Unknown error"
+				fn_script_log "Graceful: telnet: Unknown error"
 			fi
 			echo -en "\n" | tee -a "${scriptlog}"
 			echo -en "Telnet output:" | tee -a "${scriptlog}"
@@ -138,10 +138,10 @@ fn_stop_graceful_sdtd(){
 		fi
 	else
 		fn_print_dots "Graceful: telnet: "
-		fn_scriptlog "Graceful: telnet: "
+		fn_script_log "Graceful: telnet: "
 		fn_print_fail "Graceful: telnet: expect not installed: "
 		fn_print_fail_eol_nl
-		fn_scriptlog "Graceful: telnet: expect not installed: FAIL"
+		fn_script_log "Graceful: telnet: expect not installed: FAIL"
 	fi
 	sleep 1
 	fn_stop_tmux
@@ -200,7 +200,7 @@ fn_stop_ark(){
 
 fn_stop_teamspeak3(){
 	fn_print_dots "${servername}"
-	fn_scriptlog "${servername}"
+	fn_script_log "${servername}"
 	sleep 1
 	${filesdir}/ts3server_startscript.sh stop > /dev/null 2>&1
 	check_status.sh
@@ -208,16 +208,16 @@ fn_stop_teamspeak3(){
 		# Remove lock file
 		rm -f "${rootdir}/${lockselfname}"
 		fn_print_ok_nl "${servername}"
-		fn_scriptlog "Stopped ${servername}"
+		fn_script_log "Stopped ${servername}"
 	else
 		fn_print_fail_nl "Unable to stop${servername}"
-		fn_scriptlog "Unable to stop${servername}"
+		fn_script_log "Unable to stop${servername}"
 	fi
 }
 
 fn_stop_tmux(){
 	fn_print_dots "${servername}"
-	fn_scriptlog "tmux kill-session: ${servername}"
+	fn_script_log "tmux kill-session: ${servername}"
 	sleep 1
 	# Kill tmux session
 	tmux kill-session -t "${servicename}" > /dev/null 2>&1
@@ -233,10 +233,10 @@ fn_stop_tmux(){
                         echo -en "\n"
                 fi
 		fn_print_ok_nl "${servername}"
-		fn_scriptlog "Stopped ${servername}"
+		fn_script_log "Stopped ${servername}"
 	else
 		fn_print_fail_nl "Unable to stop${servername}"
-		fn_scriptlog "Unable to stop${servername}"
+		fn_script_log "Unable to stop${servername}"
 	fi
 }
 
@@ -246,7 +246,7 @@ fn_stop_pre_check(){
 		check_status.sh
 		if [ "${status}" == "0" ]; then
 			fn_print_ok_nl "${servername} is already stopped"
-			fn_scriptlog "${servername} is already stopped"
+			fn_script_log "${servername} is already stopped"
 		else
 			fn_stop_teamspeak3
 		fi
@@ -254,7 +254,7 @@ fn_stop_pre_check(){
 		check_status.sh
 		if [ "${status}" == "0" ]; then
 			fn_print_ok_nl "${servername} is already stopped"
-			fn_scriptlog "${servername} is already stopped"
+			fn_script_log "${servername} is already stopped"
 		else
 			fn_stop_graceful_select
 		fi
@@ -264,6 +264,6 @@ fn_stop_pre_check(){
 check.sh
 info_config.sh
 fn_print_dots "${servername}"
-fn_scriptlog "${servername}"
+fn_script_log "${servername}"
 sleep 1
 fn_stop_pre_check

+ 3 - 3
lgsm/functions/command_ts3_server_pass.sh

@@ -28,14 +28,14 @@ fn_serveradmin_password_prompt(){
 		* ) echo "Please answer yes or no.";;
 	esac
 	done
-	fn_scriptlog "Initiating ${gamename} ServerAdmin password change"
+	fn_script_log "Initiating ${gamename} ServerAdmin password change"
 	read -p "Enter new password : " newpassword
 	}
 
 
 	fn_serveradmin_password_set(){
 	fn_print_info_nl "Applying new password"
-	fn_scriptlog "Applying new password"
+	fn_script_log "Applying new password"
 	sleep 1
 	# Stop any running server
 	command_stop.sh
@@ -47,7 +47,7 @@ fn_serveradmin_password_prompt(){
 	command_stop.sh
 	ts3serverpass="0"
 	fn_print_ok_nl "Password applied"
-	fn_scriptlog "New ServerAdmin password applied"
+	fn_script_log "New ServerAdmin password applied"
 	sleep 1
 }
 

+ 3 - 3
lgsm/functions/command_update_functions.sh

@@ -9,7 +9,7 @@ lgsm_version="210516"
 function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 check.sh
 fn_print_dots "Updating functions"
-fn_scriptlog "Updating functions"
+fn_script_log "Updating functions"
 sleep 1
 echo -ne "\n"
 
@@ -30,9 +30,9 @@ fi
 
 if [ "${exitcode}" == "0" ]; then
 	fn_print_ok "Updating functions"
-	fn_scriptlog "Success! Updating functions"
+	fn_script_log "Success! Updating functions"
 else
 	fn_print_fail "Updating functions"
-	fn_scriptlog "Failure! Updating functions"
+	fn_script_log "Failure! Updating functions"
 fi
 echo -ne "\n"

+ 2 - 2
lgsm/functions/command_validate.sh

@@ -17,7 +17,7 @@ fn_validation(){
 	fn_print_dots "Checking server files"
 	sleep 1
 	fn_print_ok "Checking server files"
-	fn_scriptlog "Checking server files"
+	fn_script_log "Checking server files"
 	sleep 1
 
 	cd "${rootdir}/steamcmd"
@@ -35,7 +35,7 @@ fn_validation(){
 	fi
 
 	fix.sh
-	fn_scriptlog "Checking complete"
+	fn_script_log "Checking complete"
 }
 
 check_status.sh

+ 12 - 12
lgsm/functions/core_dl.sh

@@ -28,15 +28,15 @@ fn_dl_md5(){
 			fn_print_fail_eol_nl
 			echo "${filename} returned MD5 checksum: ${md5sumcmd}"
 			echo "expected MD5 checksum: ${md5}"
-			fn_scriptlog "verifying ${filename} with MD5: FAIL"
-			fn_scriptlog "${filename} returned MD5 checksum: ${md5sumcmd}"
-			fn_scriptlog "expected MD5 checksum: ${md5}"
+			fn_script_log "verifying ${filename} with MD5: FAIL"
+			fn_script_log "${filename} returned MD5 checksum: ${md5sumcmd}"
+			fn_script_log "expected MD5 checksum: ${md5}"
 			exit 1
 		else
 			fn_print_ok_eol_nl
-			fn_scriptlog "verifying ${filename} with MD5: OK"
-			fn_scriptlog "${filename} returned MD5 checksum: ${md5sumcmd}"
-			fn_scriptlog "expected MD5 checksum: ${md5}"
+			fn_script_log "verifying ${filename} with MD5: OK"
+			fn_script_log "${filename} returned MD5 checksum: ${md5sumcmd}"
+			fn_script_log "expected MD5 checksum: ${md5}"
 		fi
 	fi
 }
@@ -51,7 +51,7 @@ fn_dl_extract(){
 	extractdir="${3}"
 	# extracts archives
 	echo -ne "extracting ${filename}..."
-	fn_scriptlog "extracting download"
+	fn_script_log "extracting download"
 	mime=$(file -b --mime-type "${filedir}/${filename}")
 
 	if [ "${mime}" == "application/gzip" ]||[ "${mime}" == "application/x-gzip" ]; then
@@ -62,7 +62,7 @@ fn_dl_extract(){
 	local exitcode=$?
 	if [ ${exitcode} -ne 0 ]; then
 		fn_print_fail_eol_nl
-		fn_scriptlog "extracting download: FAIL"
+		fn_script_log "extracting download: FAIL"
 		echo "${tarcmd}" | tee -a "${scriptlog}"
 		exit ${exitcode}
 	else
@@ -75,12 +75,12 @@ fn_fetch_trap() {
 	echo ""
 	echo -ne "downloading ${filename}: "
 	fn_print_canceled_eol_nl
-	fn_scriptlog "downloading ${filename}: CANCELED"
+	fn_script_log "downloading ${filename}: CANCELED"
 	sleep 1
 	rm -f "${filedir}/${filename}" | tee -a "${scriptlog}"
 	echo -ne "downloading ${filename}: "
 	fn_print_removed_eol_nl
-	fn_scriptlog "downloading ${filename}: REMOVED"
+	fn_script_log "downloading ${filename}: REMOVED"
 	exit
 }
 
@@ -125,7 +125,7 @@ fn_fetch_file(){
 			if [ ${exitcode} -ne 0 ]; then
 				fn_print_fail_eol_nl
 				if [ -f "${scriptlog}" ]; then
-					fn_scriptlog "downloading ${filename}: FAIL"
+					fn_script_log "downloading ${filename}: FAIL"
 				fi
 				echo "${curlcmd}" | tee -a "${scriptlog}"
 				echo -e "${fileurl}\n" | tee -a "${scriptlog}"
@@ -133,7 +133,7 @@ fn_fetch_file(){
 			else
 				fn_print_ok_eol_nl
 				if [ -f "${scriptlog}" ]; then
-					fn_scriptlog "downloading ${filename}: OK"
+					fn_script_log "downloading ${filename}: OK"
 				fi
 			fi
 			# remove trap

+ 1 - 1
lgsm/functions/core_functions.sh

@@ -160,7 +160,7 @@ fn_restart(){
 local modulename="Restarting"
 info_config.sh
 if [ -d "${scriptlogdir}" ]; then
-	fn_scriptlog "${servername}"
+	fn_script_log "${servername}"
 fi
 command_stop.sh
 command_start.sh

+ 3 - 3
lgsm/functions/fix.sh

@@ -12,17 +12,17 @@ fn_fix_msg_start(){
 	fn_print_dots "Applying ${fixname} fix: ${gamename}"
 	sleep 1
 	fn_print_info "Applying ${fixname} fix: ${gamename}"
-	fn_scriptlog "Applying ${fixname} fix: ${gamename}"
+	fn_script_log "Applying ${fixname} fix: ${gamename}"
 	sleep 1
 }
 
 fn_fix_msg_end(){
 	if [ $? -ne 0 ]; then
 		fn_print_fail_nl "Applying ${fixname} fix: ${gamename}"
-		fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}"
+		fn_script_log "Failure! Applying ${fixname} fix: ${gamename}"
 	else
 		fn_print_ok_nl "Applying ${fixname} fix: ${gamename}"
-		fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}"
+		fn_script_log "Complete! Applying ${fixname} fix: ${gamename}"
 	fi
 }
 

+ 3 - 3
lgsm/functions/fn_update_functions

@@ -7,16 +7,16 @@ lgsm_version="210516"
 # Description: LEGACY FUNCTION Deletes the functions dir to allow re-downloading of functions from GitHub.
 
 fn_print_dots "Updating functions"
-fn_scriptlog "Updating functions"
+fn_script_log "Updating functions"
 sleep 1
 echo -ne "\n"
 rm -rfv "${rootdir}/functions/"*
 exitcode=$?
 if [ "${exitcode}" == "0" ]; then
 	fn_print_ok "Updating functions"
-	fn_scriptlog "Success! Updating functions"
+	fn_script_log "Success! Updating functions"
 else
 	fn_print_fail "Updating functions"
-	fn_scriptlog "Failure! Updating functions"
+	fn_script_log "Failure! Updating functions"
 fi
 echo -ne "\n"

+ 1 - 1
lgsm/functions/install_complete.sh

@@ -14,7 +14,7 @@ if [ "${gamename}" == "Don't Starve Together" ]; then
 fi
 echo "================================="
 echo "Install Complete!"
-fn_scriptlog "Install Complete!"
+fn_script_log "Install Complete!"
 echo ""
 echo "To start server type:"
 echo "./${selfname} start"

+ 5 - 5
lgsm/functions/install_gslt.sh

@@ -14,16 +14,16 @@ echo "================================="
 sleep 1
 if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
 	echo "GSLT is required to run a public ${gamename} server"
-	fn_scriptlog "GSLT is required to run a public ${gamename} server"
+	fn_script_log "GSLT is required to run a public ${gamename} server"
 else
 	echo "GSLT is an optional feature for ${gamename} server"
-	fn_scriptlog "GSLT is an optional feature for ${gamename} server"
+	fn_script_log "GSLT is an optional feature for ${gamename} server"
 fi
 
 echo "Get more info and a token here:"
 echo "https://gameservermanagers.com/gslt"
-fn_scriptlog "Get more info and a token here:"
-fn_scriptlog "https://gameservermanagers.com/gslt"
+fn_script_log "Get more info and a token here:"
+fn_script_log "https://gameservermanagers.com/gslt"
 echo ""
 if [ -z "${autoinstall}" ]; then
 	echo "Enter token below (Can be blank)."
@@ -33,5 +33,5 @@ if [ -z "${autoinstall}" ]; then
 fi
 sleep 1
 echo "The GSLT can be changed by editing ${selfname}."
-fn_scriptlog "The GSLT can be changed by editing ${selfname}."
+fn_script_log "The GSLT can be changed by editing ${selfname}."
 echo ""

+ 1 - 1
lgsm/functions/install_logs.sh

@@ -40,4 +40,4 @@ if [ -d "${rootdir}/Steam/logs" ]; then
 	fi
 fi
 sleep 1
-fn_scriptlog "logs installed"
+fn_script_log "logs installed"

+ 2 - 2
lgsm/functions/install_server_files.sh

@@ -32,7 +32,7 @@ fn_install_server_files_steamcmd(){
 
 			if [ "${counter}" -ge "2" ]; then
 				fn_print_warning_nl "SteamCMD did not complete the download, retrying: Attempt ${counter}"
-				fn_scriptlog "SteamCMD did not complete the download, retrying: Attempt ${counter}"
+				fn_script_log "SteamCMD did not complete the download, retrying: Attempt ${counter}"
 			fi
 
 			if [ "${counter}" -ge "7" ]; then
@@ -70,7 +70,7 @@ fn_install_server_files_steamcmd(){
 			fi
 		elif [ "${counter}" -ge "11" ]; then
 			fn_print_failure_nl "SteamCMD did not complete the download, too many retrys"
-			fn_scriptlog "SteamCMD did not complete the download, too many retrys"
+			fn_script_log "SteamCMD did not complete the download, too many retrys"
 			break
 		fi
 	done

+ 1 - 1
lgsm/functions/install_ut2k4_key.sh

@@ -20,7 +20,7 @@ if [ -z "${autoinstall}" ]; then
 	read CODE
 	echo ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey"
 	if [ -f "${systemdir}/cdkey" ]; then
-		fn_scriptlog "UT2K4 Server CD Key created"
+		fn_script_log "UT2K4 Server CD Key created"
 	fi
 else
 	echo "You can add your key using the following command"

+ 4 - 4
lgsm/functions/logs.sh

@@ -20,7 +20,7 @@ fi
 if [ "${function_selfname}" == "command_start.sh" ] && [ -n "${gamelogfile}" ]; then
 	if [ -n "$(find "${systemdir}" -name "gamelog*.log")" ]; then
 		fn_print_info "Moving game logs to ${gamelogdir}"
-		fn_scriptlog "Moving game logs to ${gamelogdir}"
+		fn_script_log "Moving game logs to ${gamelogdir}"
 		echo -en "\n"
 		sleep 1
 		mv "${systemdir}"/gamelog*.log "${gamelogdir}"
@@ -39,9 +39,9 @@ if [ $(find "${scriptlogdir}"/ -type f -mtime +"${logdays}"|wc -l) -ne "0" ]; th
 	scriptcount="0" ; consolecount="0" ; gamecount="0" ; srcdscount="0" ; smcount="0" ; ulxcount="0" ; darkrpcount="0" ; legacycount="0"
 	sleep 1
 	fn_print_ok_nl "Starting"
-	fn_scriptlog "Starting"
+	fn_script_log "Starting"
 	fn_print_info_nl "Removing logs older than "${logdays}" days"
-	fn_scriptlog "Removing logs older than "${logdays}" days"
+	fn_script_log "Removing logs older than "${logdays}" days"
 	# Logging logfiles to be removed according to "${logdays}", counting and removing them
 	# Script logfiles
 	find "${scriptlogdir}"/ -type f -mtime +"${logdays}"| tee >> "${scriptlog}"
@@ -98,5 +98,5 @@ if [ $(find "${scriptlogdir}"/ -type f -mtime +"${logdays}"|wc -l) -ne "0" ]; th
 	count=$((${scriptcount} + ${consolecount} + ${gamecount} + ${srcdscount} + ${smcount} + ${ulxcount} + ${darkrpcount} + ${legacycount}))
 	# Job done
 	fn_print_ok_nl "Removed ${count} log files"
-	fn_scriptlog "Removed ${count} log files"
+	fn_script_log "Removed ${count} log files"
 fi

+ 5 - 5
lgsm/functions/monitor_gsquery.sh

@@ -34,7 +34,7 @@ if [ "${gsquery}" == "yes" ]; then
 	fi
 
 	fn_print_info "Querying port: gsquery.py enabled"
-	fn_scriptlog "Querying port: gsquery.py enabled"
+	fn_script_log "Querying port: gsquery.py enabled"
 	sleep 1
 
 	# Will query up to 4 times every 15 seconds.
@@ -44,7 +44,7 @@ if [ "${gsquery}" == "yes" ]; then
 	for queryattempt in {1..5}; do
 		fn_print_dots "Querying port: ${ip}:${port} : ${totalseconds}/${queryattempt} : "
 		fn_print_querying_eol
-		fn_scriptlog "Querying port: ${ip}:${port} : ${queryattempt} : QUERYING"
+		fn_script_log "Querying port: ${ip}:${port} : ${queryattempt} : QUERYING"
 
 		gsquerycmd=$("${functionsdir}"/gsquery.py -a "${ip}" -p "${port}" -e "${engine}" 2>&1)
 		exitcode=$?
@@ -54,18 +54,18 @@ if [ "${gsquery}" == "yes" ]; then
 			# Server OK
 			fn_print_ok "Querying port: ${ip}:${port} : ${queryattempt} : "
 			fn_print_ok_eol_nl
-			fn_scriptlog "Querying port: ${ip}:${port} : ${queryattempt} : OK"
+			fn_script_log "Querying port: ${ip}:${port} : ${queryattempt} : OK"
 			sleep 1
 			exit
 		else
 			# Server failed query
-			fn_scriptlog "Querying port: ${ip}:${port} : ${queryattempt} : ${gsquerycmd}"
+			fn_script_log "Querying port: ${ip}:${port} : ${queryattempt} : ${gsquerycmd}"
 
 			if [ "${queryattempt}" == "5" ]; then
 				# Server failed query 4 times confirmed failure
 				fn_print_fail "Querying port: ${ip}:${port} : ${totalseconds}/${queryattempt} : "
 				fn_print_fail_eol_nl
-				fn_scriptlog "Querying port: ${ip}:${port} : ${queryattempt} : FAIL"
+				fn_script_log "Querying port: ${ip}:${port} : ${queryattempt} : FAIL"
 				sleep 1
 
 				# Send alert if enabled

+ 31 - 31
lgsm/functions/update_check.sh

@@ -23,7 +23,7 @@ fn_appmanifestcheck(){
 	if [ "${appmanifestfilewc}" -ge "2" ]; then
 		sleep 1
 		fn_print_warn "Multiple appmanifest_${appid}.acf files found"
-		fn_scriptlog "Warning! Multiple appmanifest_${appid}.acf files found"
+		fn_script_log "Warning! Multiple appmanifest_${appid}.acf files found"
 		sleep 2
 		fn_print_dots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files"
 		sleep 1
@@ -34,7 +34,7 @@ fn_appmanifestcheck(){
 		fn_appmanifestinfo
 		if [ "${appmanifestfilewc}" -ge "2" ]; then
 			fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
-			fn_scriptlog "Failure! Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
+			fn_script_log "Failure! Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
 			sleep 1
 			echo ""
 			echo "	Check user permissions"
@@ -45,10 +45,10 @@ fn_appmanifestcheck(){
 		else
 			sleep 1
 			fn_print_ok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
-			fn_scriptlog "Success! Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
+			fn_script_log "Success! Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
 			sleep 1
 			fn_print_info_nl "Forcing update to correct issue"
-			fn_scriptlog "Forcing update to correct issue"
+			fn_script_log "Forcing update to correct issue"
 			sleep 1
 			update_dl.sh
 			update_check.sh
@@ -56,15 +56,15 @@ fn_appmanifestcheck(){
 	elif [ "${appmanifestfilewc}" -eq "0" ]; then
 		if [ "${forceupdate}" == "1" ]; then
 			fn_print_fail "Still no appmanifest_${appid}.acf found: Unable to update"
-			fn_scriptlog "Warning! Still no appmanifest_${appid}.acf found: Unable to update"
+			fn_script_log "Warning! Still no appmanifest_${appid}.acf found: Unable to update"
 			exit 1
 		fi
 		forceupdate=1
 		fn_print_warn "No appmanifest_${appid}.acf found"
-		fn_scriptlog "Warning! No appmanifest_${appid}.acf found"
+		fn_script_log "Warning! No appmanifest_${appid}.acf found"
 		sleep 2
 		fn_print_info_nl "Forcing update to correct issue"
-		fn_scriptlog "Forcing update to correct issue"
+		fn_script_log "Forcing update to correct issue"
 		sleep 1
 		update_dl.sh
 		update_check.sh
@@ -74,7 +74,7 @@ fn_appmanifestcheck(){
 fn_logupdaterequest(){
 	# Checks for server update requests from server logs.
 	fn_print_dots "Checking for update: Server logs"
-	fn_scriptlog "Checking for update: Server logs"
+	fn_script_log "Checking for update: Server logs"
 	sleep 1
 	requestrestart=$(grep -Ec "MasterRequestRestart" "${consolelog}")
 	if [ "${requestrestart}" -ge "1" ]; then
@@ -110,7 +110,7 @@ fn_steamcmdcheck(){
 	fn_appmanifestcheck
 	# Checks for server update from SteamCMD
 	fn_print_dots "Checking for update: SteamCMD"
-	fn_scriptlog "Checking for update: SteamCMD"
+	fn_script_log "Checking for update: SteamCMD"
 	sleep 1
 
 	# Gets currentbuild
@@ -135,14 +135,14 @@ fn_steamcmdcheck(){
 	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+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
 	if [ -z "${availablebuild}" ]; then
 		fn_print_fail "Checking for update: SteamCMD"
-		fn_scriptlog "Failure! Checking for update: SteamCMD"
+		fn_script_log "Failure! Checking for update: SteamCMD"
 		sleep 1
 		fn_print_fail_nl "Checking for update: SteamCMD: Not returning version info"
-		fn_scriptlog "Failure! Checking for update: SteamCMD: Not returning version info"
+		fn_script_log "Failure! Checking for update: SteamCMD: Not returning version info"
 		exit 1
 	else
 		fn_print_ok "Checking for update: SteamCMD"
-		fn_scriptlog "Success! Checking for update: SteamCMD"
+		fn_script_log "Success! Checking for update: SteamCMD"
 		sleep 1
 	fi
 
@@ -163,10 +163,10 @@ fn_steamcmdcheck(){
 		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}"
+		fn_script_log "Update available"
+		fn_script_log "Current build: ${currentbuild}"
+		fn_script_log "Available build: ${availablebuild}"
+		fn_script_log "${currentbuild} > ${availablebuild}"
 
 		unset updateonstart
 		check_status.sh
@@ -187,8 +187,8 @@ fn_steamcmdcheck(){
 		echo -e "	https://steamdb.info/app/${appid}/"
 		echo -e ""
 		fn_print_ok_nl "No update available"
-		fn_scriptlog "Current build: ${currentbuild}"
-		fn_scriptlog "Available build: ${availablebuild}"
+		fn_script_log "Current build: ${currentbuild}"
+		fn_script_log "Available build: ${availablebuild}"
 	fi
 }
 
@@ -197,7 +197,7 @@ fn_steamcmdcheck(){
 fn_teamspeak3_check(){
 	# Checks for server update from teamspeak.com using a mirror dl.4players.de
 	fn_print_dots "Checking for update: teamspeak.com"
-	fn_scriptlog "Checking for update: teamspeak.com"
+	fn_script_log "Checking for update: teamspeak.com"
 	sleep 1
 
 	# Gets currentbuild info
@@ -206,10 +206,10 @@ fn_teamspeak3_check(){
 		fn_print_fail "Checking for update: teamspeak.com"
 		sleep 1
 		fn_print_fail_nl "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"
+		fn_script_log "Failure! Checking for update: teamspeak.com: No logs with server version found"
 		sleep 2
 		fn_print_info_nl "Checking for update: teamspeak.com: Forcing server restart"
-		fn_scriptlog "Checking for update: teamspeak.com: Forcing server restart"
+		fn_script_log "Checking for update: teamspeak.com: Forcing server restart"
 		sleep 2
 		command_stop.sh
 		command_start.sh
@@ -217,7 +217,7 @@ fn_teamspeak3_check(){
 		# If still failing will exit
 		if [ -z "$(find ./* -name 'ts3server*_0.log')" ]; then
 			fn_print_fail_nl "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"
+			fn_script_log "Failure! Checking for update: teamspeak.com: Still No logs with server version found"
 			exit 1
 		fi
 	fi
@@ -260,15 +260,15 @@ fn_teamspeak3_check(){
 	# Checks availablebuild info is available
 	if [ -z "${availablebuild}" ]; then
 		fn_print_fail "Checking for update: teamspeak.com"
-		fn_scriptlog "Checking for update: teamspeak.com"
+		fn_script_log "Checking for update: teamspeak.com"
 		sleep 1
 		fn_print_fail "Checking for update: teamspeak.com: Not returning version info"
-		fn_scriptlog "Failure! Checking for update: teamspeak.com: Not returning version info"
+		fn_script_log "Failure! Checking for update: teamspeak.com: Not returning version info"
 		sleep 2
 		exit 1
 	else
 		fn_print_ok "Checking for update: teamspeak.com"
-		fn_scriptlog "Success! Checking for update: teamspeak.com"
+		fn_script_log "Success! Checking for update: teamspeak.com"
 		sleep 1
 	fi
 
@@ -291,10 +291,10 @@ fn_teamspeak3_check(){
 		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}"
+		fn_script_log "Update available"
+		fn_script_log "Current build: ${currentbuild}"
+		fn_script_log "Available build: ${availablebuild}"
+		fn_script_log "${currentbuild} > ${availablebuild}"
 
 		unset updateonstart
 		check_status.sh
@@ -317,8 +317,8 @@ fn_teamspeak3_check(){
 		echo -e "	Available version: \e[0;32m${availablebuild}\e[0;39m"
 		echo -e ""
 		fn_print_ok_nl "No update available"
-		fn_scriptlog "Current build: ${currentbuild}"
-		fn_scriptlog "Available build: ${availablebuild}"
+		fn_script_log "Current build: ${currentbuild}"
+		fn_script_log "Available build: ${availablebuild}"
 	fi
 }
 

+ 8 - 8
lgsm/functions/update_dl.sh

@@ -32,39 +32,39 @@ fn_steamcmd_dl(){
 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"
+	fn_script_log "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"
+	fn_script_log "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}"
+		fn_script_log "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"
+		fn_script_log "Failure! Unable to update"
 		exit ${status}
 	fi
 	echo -e "copying to ${filesdir}...\c"
-	fn_scriptlog "Copying to ${filesdir}"
+	fn_script_log "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}"
+		fn_script_log "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"
+		fn_script_log "Failure! Unable to update"
 		exit ${status}
 	fi
 	rm -f teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2
@@ -76,7 +76,7 @@ info_config.sh
 fn_print_dots "Updating ${servername}"
 sleep 1
 fn_print_ok_nl "Updating ${servername}"
-fn_scriptlog "Updating ${servername}"
+fn_script_log "Updating ${servername}"
 sleep 1
 if [ "${gamename}" == "Teamspeak 3" ]; then
 	fn_teamspeak3_dl