فهرست منبع

colours are now variables

Daniel Gibbs 10 سال پیش
والد
کامیت
60110fdc8c

+ 3 - 3
functions/core_functions.sh

@@ -46,15 +46,15 @@ if [ ! -f "${filedir}/${filename}" ]; then
 	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 -e "${red}FAIL${default}\n"
 			echo "${curlfetch}"
 			echo -e "${githuburl}\n"
 			exit 1
 		else
-			echo -e "\e[0;32mOK\e[0m"
+			echo -e "${green}OK${default}"
 		fi
 	else
-		echo -e "\e[0;31mFAIL\e[0m\n"
+		echo -e "${red}FAIL${default}\n"
 		echo "Curl is not installed!"
 		echo -e ""
 		exit 1

+ 1 - 1
lgsm/functions/check_config.sh

@@ -10,7 +10,7 @@ local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 if [ ! -e "${servercfgfullpath}" ]; then
 	if [ "${gamename}" != "Hurtworld" ]; then
-		fn_print_warn_nl "Config file missing!"
+		fn_print_warn_nl "Configuration file missing!"
 		echo "${servercfgfullpath}"
 		fn_script_log_warn "Configuration file missing!"
 		fn_script_log_warn "${servercfgfullpath}"

+ 4 - 4
lgsm/functions/check_deps.sh

@@ -21,14 +21,14 @@ fn_deps_detector(){
 	if [ "${depstatus}" == "0" ]; then
 		missingdep=0
 		if [ "${selfname}" == "command_install.sh" ]; then
-			echo -e "\e[0;32m${deptocheck}\e[0m"
+			echo -e "${green}${deptocheck}${default}"
 			sleep 0.5
 		fi
 	else
 		# if missing dependency is found
 		missingdep=1
 		if [ "${selfname}" == "command_install.sh" ]; then
-			echo -e "\e[0;31m${deptocheck}\e[0m"
+			echo -e "${red}${deptocheck}${default}"
 			sleep 0.5
 		fi
 	fi
@@ -66,8 +66,8 @@ fn_found_missing_deps(){
 	if [ "${#array_deps_missing[@]}" != "0" ]; then
 		fn_print_dots "Checking dependencies"
 		sleep 2
-		fn_print_warn "Checking dependencies: missing: \e[0;31m${array_deps_missing[@]}\e[0m"
-		fn_script_log_info "Checking dependencies: missing: \e[0;31m${array_deps_missing[@]}\e[0m"
+		fn_print_error "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}"
+		fn_script_log_error "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}"
 		sleep 1
 		echo -e ""
 		sudo -n true > /dev/null 2>&1

+ 6 - 6
lgsm/functions/check_glibc.sh

@@ -15,22 +15,22 @@ info_distro.sh
 if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
 	:
 elif [ "${glibcrequired}" == "UNKNOWN" ]; then
-		fn_print_info_nl "Glibc fix: \e[0;31m${glibcrequired}\e[0m"
-		echo -e "	* glibc required: \e[0;31m${glibcrequired}\e[0m"
+		fn_print_info_nl "Glibc fix: ${red}${glibcrequired}${default}"
+		echo -e "	* glibc required: ${red}${glibcrequired}${default}"
 		echo -e "	* glibc installed: ${glibcversion}"
 elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
 	if [ "${glibcfix}" == "yes" ]; then
 		if [ "${selfname}" != "command_install.sh" ]; then
-			fn_print_info_nl "Glibc fix: \e[0;32mUsing Glibc fix\e[0m"
-			echo -e "	* glibc required: \e[0;31m${glibcrequired}\e[0m"
+			fn_print_info_nl "Glibc fix: ${green}Using Glibc fix${default}"
+			echo -e "	* glibc required: ${red}${glibcrequired}${default}"
 			echo -e "	* glibc installed: ${glibcversion}"
 			fix_glibc.sh
 		fi
 	else
-		fn_print_warn_nl "Glibc fix: \e[0;31mNo Glibc fix available!\e[0m"
+		fn_print_warn_nl "Glibc fix: ${red}No Glibc fix available!${default}"
 		echo -en "\n"
 		echo -e "	* glibc required: ${glibcrequired}"
-		echo -e "	* glibc installed: \e[0;31m${glibcversion}\e[0m"
+		echo -e "	* glibc installed: ${red}${glibcversion}${default}"
 		echo -en "\n"
 		fn_print_infomation "The game server will probably not work. A distro upgrade is required!"
 		sleep 5

+ 80 - 80
lgsm/functions/command_details.sh

@@ -23,15 +23,15 @@ fn_details_os(){
 	# GLIBC:     2.19
 
 	echo -e ""
-	echo -e "\e[93mDistro Details\e[0m"
+	echo -e "${lightyellow}Distro Details${default}"
 	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${glibcversion}"
+		echo -e "${blue}Distro:\t${default}${os}"
+		echo -e "${blue}Arch:\t${default}${arch}"
+		echo -e "${blue}Kernel:\t${default}${kernel}"
+		echo -e "${blue}Hostname:\t${default}$HOSTNAME"
+		echo -e "${blue}tmux:\t${default}${tmuxv}"
+		echo -e "${blue}GLIBC:\t${default}${glibcversion}"
 	} | column -s $'\t' -t
 }
 
@@ -47,17 +47,17 @@ fn_details_performance(){
 	# Swap:      0B      0B     0B
 
 	echo -e ""
-	echo -e "\e[93mPerformance\e[0m"
+	echo -e "${lightyellow}Performance${default}"
 	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}"
+		echo -e "${blue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m"
+		echo -e "${blue}Avg Load:\t${default}${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"
+		echo -e "${blue}Mem:\t${blue}total\t used\t free${default}"
+		echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}${default}"
+		echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}"
 	} | column -s $'\t' -t
 }
 
@@ -74,17 +74,17 @@ fn_details_disk(){
 	# Backups:  	2G
 
 	echo -e ""
-	echo -e "\e[93mStorage\e[0m"
+	echo -e "${lightyellow}Storage${default}"
 	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[34mLGSM Total:\t\e[0m${rootdirdu}"
-		echo -e "\e[34mServerfiles:\t\e[0m${filesdirdu}"
+		echo -e "${blue}Filesystem:\t${default}${filesystem}"
+		echo -e "${blue}Total:\t${default}${totalspace}"
+		echo -e "${blue}Used:\t${default}${usedspace}"
+		echo -e "${blue}Available:\t${default}${availspace}"
+		echo -e "${blue}LGSM Total:\t${default}${rootdirdu}"
+		echo -e "${blue}Serverfiles:\t${default}${filesdirdu}"
 		if [ -d "${backupdir}" ]; then
-			echo -e "\e[34mBackups:\t\e[0m${backupdirdu}"
+			echo -e "${blue}Backups:\t${default}${backupdirdu}"
 		fi
 	} | column -s $'\t' -t
 }
@@ -101,65 +101,65 @@ fn_details_gameserver(){
 	# Status:           OFFLINE
 
 	echo -e ""
-	echo -e "\e[92m${gamename} Server Details\e[0m"
+	echo -e "\e[92m${gamename} Server Details${default}"
 	printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	{
 		# Server name
-		echo -e "\e[34mServer name:\t\e[0m${servername}"
+		echo -e "${blue}Server name:\t${default}${servername}"
 
 		# Server ip
-		echo -e "\e[34mServer IP:\t\e[0m${ip}:${port}"
+		echo -e "${blue}Server IP:\t${default}${ip}:${port}"
 
 		# Server password
 		if [ -n "${serverpassword}" ]; then
-			echo -e "\e[34mServer password:\t\e[0m${serverpassword}"
+			echo -e "${blue}Server password:\t${default}${serverpassword}"
 		fi
 
 		# RCON password
 		if [ -n "${rconpassword}" ]; then
-			echo -e "\e[34mRCON password:\t\e[0m${rconpassword}"
+			echo -e "${blue}RCON password:\t${default}${rconpassword}"
 		fi
 
 		# Admin password
 		if [ -n "${adminpassword}" ]; then
-			echo -e "\e[34mAdmin password:\t\e[0m${adminpassword}"
+			echo -e "${blue}Admin password:\t${default}${adminpassword}"
 		fi
 
 		# Stats password (Quake Live)
 		if [ -n "${statspassword}" ]; then
-			echo -e "\e[34mStats password:\t\e[0m${statspassword}"
+			echo -e "${blue}Stats password:\t${default}${statspassword}"
 		fi
 
 		# Slots
 		if [ -n "${slots}" ]; then
-			echo -e "\e[34mSlots:\t\e[0m${slots}"
+			echo -e "${blue}Slots:\t${default}${slots}"
 		fi
 
 		# Game mode
 		if [ -n "${gamemode}" ]; then
-			echo -e "\e[34mGame mode:\t\e[0m${gamemode}"
+			echo -e "${blue}Game mode:\t${default}${gamemode}"
 		fi
 
 		# Game world
 		if [ -n "${gameworld}" ]; then
-			echo -e "\e[34mGame world:\t\e[0m${gameworld}"
+			echo -e "${blue}Game world:\t${default}${gameworld}"
 		fi
 
 		# Tick rate
 		if [ -n "${tickrate}" ]; then
-			echo -e "\e[34mTick rate:\t\e[0m${tickrate}"
+			echo -e "${blue}Tick rate:\t${default}${tickrate}"
 		fi
 
 		# Teamspeak dbplugin
 		if [ -n "${dbplugin}" ]; then
-			echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}"
+			echo -e "${blue}dbplugin:\t${default}${dbplugin}"
 		fi
 
 		# Online status
 		if [ "${status}" == "0" ]; then
-			echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m"
+			echo -e "${blue}Status:\t${red}OFFLINE${default}"
 		else
-			echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m"
+			echo -e "${blue}Status:\t${green}ONLINE${default}"
 		fi
 	} | column -s $'\t' -t
 	echo -e ""
@@ -177,61 +177,61 @@ fn_details_script(){
 	# Location:            /home/lgsm/qlserver
 	# Config file:         /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
 
-	echo -e "\e[92m${selfname} Script Details\e[0m"
+	echo -e "\e[92m${selfname} Script Details${default}"
 	printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	{
 		# Service name
-		echo -e "\e[34mService name:\t\e[0m${servicename}"
+		echo -e "${blue}Service name:\t${default}${servicename}"
 
 		# Script version
 		if [ -n "${version}" ]; then
-			echo -e "\e[34m${selfname} version:\t\e[0m${version}"
+			echo -e "${blue}${selfname} version:\t${default}${version}"
 		fi
 
 		# User
-		echo -e "\e[34mUser:\t\e[0m$(whoami)"
+		echo -e "${blue}User:\t${default}$(whoami)"
 
 		# GLIBC required
 		if [ -n "${glibcrequired}" ]; then
 			if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
 					:
 			elif [ "${glibcrequired}" == "UNKNOWN" ]; then
-				echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired}"
+				echo -e "${blue}GLIBC required:\t${red}${glibcrequired}"
 			elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
 				if [ "${glibcfix}" == "yes" ]; then
-					echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)"
+					echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})"
 				else
-					echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;31mGLIBC version too old\e[0m)"
+					echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC version too old${default})"
 				fi
 			else
-				echo -e "\e[34mGLIBC required:\t\e[0;32m${glibcrequired}\e[0m"
+				echo -e "${blue}GLIBC required:\t${green}${glibcrequired}${default}"
 			fi
 		fi
 
 		# Email alert
-		echo -e "\e[34mEmail alert:\t\e[0m${emailalert}"
+		echo -e "${blue}Email alert:\t${default}${emailalert}"
 
 		# Pushbullet alert
-		echo -e "\e[34mPushbullet alert:\t\e[0m${pushbulletalert}"
+		echo -e "${blue}Pushbullet alert:\t${default}${pushbulletalert}"
 
 		# Update on start
-		echo -e "\e[34mUpdate on start:\t\e[0m${updateonstart}"
+		echo -e "${blue}Update on start:\t${default}${updateonstart}"
 
 		# Script location
-		echo -e "\e[34mLocation:\t\e[0m${rootdir}"
+		echo -e "${blue}Location:\t${default}${rootdir}"
 
 		# Config file location
 		if [ -n "${servercfgfullpath}" ]; then
 			if [ -f "${servercfgfullpath}" ]; then
-				echo -e "\e[34mConfig file:\t\e[0m${servercfgfullpath}"
+				echo -e "${blue}Config file:\t${default}${servercfgfullpath}"
 			else
-				echo -e "\e[34mConfig file:\t\e[0m\e[0;31m${servercfgfullpath}\e[0m (\e[0;31mFILE MISSING\e[0m)"
+				echo -e "${blue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
 			fi
 		fi
 
 		# Network config file location (ARMA 3)
 		if [ -n "${networkcfgfullpath}" ]; then
-			echo -e "\e[34mNetwork config file:\t\e[0m${networkcfgfullpath}"
+			echo -e "${blue}Network config file:\t${default}${networkcfgfullpath}"
 		fi
 	} | column -s $'\t' -t
 }
@@ -247,17 +247,17 @@ fn_details_backup(){
 	#     size:          945M
 
 	echo -e ""
-	echo -e "\e[92mBackups\e[0m"
+	echo -e "\e[92mBackups${default}"
 	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}"
+			echo -e "${blue}No. of backups:\t${default}${backupcount}"
+			echo -e "${blue}Latest backup:${default}"
+			echo -e "${blue}    date:\t${default}${lastbackupdate}"
+			echo -e "${blue}    file:\t${default}${lastbackup}"
+			echo -e "${blue}    size:\t${default}${lastbackupsize}"
 		} | column -s $'\t' -t
 	fi
 }
@@ -269,7 +269,7 @@ fn_details_commandlineparms(){
 	# ./run_server_x86.sh +set net_strict 1
 
 	echo -e ""
-	echo -e "\e[92mCommand-line Parameters\e[0m"
+	echo -e "\e[92mCommand-line Parameters${default}"
 	printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	echo -e "${executable} ${parms}"
 }
@@ -281,11 +281,11 @@ fn_details_ports(){
 	# /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
 
 	echo -e ""
-	echo -e "\e[92mPorts\e[0m"
+	echo -e "\e[92mPorts${default}"
 	printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	echo -e "Change ports by editing the parameters in:"
 
-	parmslocation="\e[0;31mUNKNOWN\e[0m"
+	parmslocation="${red}UNKNOWN${default}"
 	local ports_edit_array=( "avalanche" "dontstarve" "projectzomboid" "idtech3" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "Teamspeak 3" "7 Days To Die" )
 	for port_edit in "${ports_edit_array[@]}"
 	do
@@ -309,9 +309,9 @@ fn_details_ports(){
 fn_details_statusbottom(){
 	echo -e ""
 	if [ "${status}" == "0" ]; then
-		echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m"
+		echo -e "${blue}Status:\t${red}OFFLINE${default}"
 	else
-		echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m"
+		echo -e "${blue}Status:\t${green}ONLINE${default}"
 	fi
 	echo -e ""
 }
@@ -350,7 +350,7 @@ fn_details_realvirtuality(){
 	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 "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
 		echo -e ""
 	fi
 	{
@@ -365,7 +365,7 @@ fn_details_idtech3(){
 	echo -e "netstat -atunp | grep qzeroded"
 	echo -e ""
 	if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
-		echo -e "\e[0;31mERROR!\e[0m Missing/commented ports in ${servercfg}."
+		echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
 		echo -e ""
 	fi
 	{
@@ -410,12 +410,12 @@ fn_details_spark(){
 		echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
 	} | column -s $'\t' -t
 	echo -e ""
-	echo -e "\e[92m${servername} WebAdmin\e[0m"
+	echo -e "\e[92m${servername} WebAdmin${default}"
 	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}"
+		echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
+		echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
+		echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
 	} | column -s $'\t' -t
 }
 
@@ -470,20 +470,20 @@ fn_details_sdtd(){
 		echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
 	} | column -s $'\t' -t
 	echo -e ""
-	echo -e "\e[92m${servername} WebAdmin\e[0m"
+	echo -e "\e[92m${servername} WebAdmin${default}"
 	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}"
+		echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
+		echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
+		echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
 	} | column -s $'\t' -t
 	echo -e ""
-	echo -e "\e[92m${servername} Telnet\e[0m"
+	echo -e "\e[92m${servername} Telnet${default}"
 	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}"
+		echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}"
+		echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}"
+		echo -e "${blue}Telnet password:\t${default}${telnetpass}"
 	} | column -s $'\t' -t
 }
 
@@ -535,13 +535,13 @@ fn_details_unreal(){
 		echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
 	} | column -s $'\t' -t
 	echo -e ""
-	echo -e "\e[92m${servername} WebAdmin\e[0m"
+	echo -e "\e[92m${servername} WebAdmin${default}"
 	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}"
+		echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
+		echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
+		echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
+		echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
 	} | column -s $'\t' -t
 }
 

+ 3 - 3
lgsm/functions/core_functions.sh

@@ -49,15 +49,15 @@ if [ ! -f "${filedir}/${filename}" ]; then
 	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 -e "${red}FAIL${default}\n"
 			echo "${curlfetch}"
 			echo -e "${githuburl}\n"
 			exit 1
 		else
-			echo -e "\e[0;32mOK\e[0m"
+			echo -e "${green}OK${default}"
 		fi
 	else
-		echo -e "\e[0;31mFAIL\e[0m\n"
+		echo -e "${red}FAIL${default}\n"
 		echo "Curl is not installed!"
 		echo -e ""
 		exit 1

+ 109 - 109
lgsm/functions/core_getopt.sh

@@ -45,30 +45,30 @@ case "${getopt}" in
 		command_dev_detect_deps.sh;;
 	*)
 	if [ -n "${getopt}" ]; then
-		echo -e "\e[0;31mUnknown command\e[0m: $0 ${getopt}"
+		echo -e "${red}Unknown command${default}: $0 ${getopt}"
 		exitcode=2
 	fi
 	echo "Usage: $0 [option]"
 	echo "${gamename} - Linux Game Server Manager - Version ${version}"
 	echo "https://gameservermanagers.com/${selfname}"
 	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
+	echo -e "${lightyellow}Commands${default}"
 	{
-		echo -e "\e[34mstart\t\e[0mst |Start the server."
-		echo -e "\e[34mstop\t\e[0msp |Stop the server."
-		echo -e "\e[34mrestart\t\e[0mr  |Restart the server."
-		echo -e "\e[34mupdate\t\e[0mu  |Checks and applies updates from SteamCMD."
-		echo -e "\e[34mforce-update\t\e[0mfu |Bypasses the check and applies updates from SteamCMD."
-		echo -e "\e[34mupdate-functions\t\e[0muf |Removes all functions so latest can be downloaded."
-		echo -e "\e[34mvalidate\t\e[0mv  |Validate server files with SteamCMD."
-		echo -e "\e[34mmonitor\t\e[0mm  |Checks that the server is running."
-		echo -e "\e[34mtest-alert\t\e[0mta |Sends test alert."
-		echo -e "\e[34mdetails\t\e[0mdt |Displays useful infomation about the server."
-		echo -e "\e[34mbackup\t\e[0mb  |Create archive of the server."
-		echo -e "\e[34mconsole\t\e[0mc  |Console allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0md  |See the output of the server directly to your terminal."
-		echo -e "\e[34minstall\t\e[0mi  |Install the server."
-		echo -e "\e[34mauto-install\t\e[0mai |Install the server, without prompts."
+		echo -e "${blue}start\t${default}st |Start the server."
+		echo -e "${blue}stop\t${default}sp |Stop the server."
+		echo -e "${blue}restart\t${default}r  |Restart the server."
+		echo -e "${blue}update\t${default}u  |Checks and applies updates from SteamCMD."
+		echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD."
+		echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
+		echo -e "${blue}validate\t${default}v  |Validate server files with SteamCMD."
+		echo -e "${blue}monitor\t${default}m  |Checks that the server is running."
+		echo -e "${blue}test-alert\t${default}ta |Sends test alert."
+		echo -e "${blue}details\t${default}dt |Displays useful infomation about the server."
+		echo -e "${blue}backup\t${default}b  |Create archive of the server."
+		echo -e "${blue}console\t${default}c  |Console allows you to access the live view of a server."
+		echo -e "${blue}debug\t${default}d  |See the output of the server directly to your terminal."
+		echo -e "${blue}install\t${default}i  |Install the server."
+		echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
 	} | column -s $'\t' -t
 	esac
 }
@@ -105,27 +105,27 @@ case "${getopt}" in
 		command_dev_detect_deps.sh;;
 	*)
 	if [ -n "${getopt}" ]; then
-		echo -e "\e[0;31mUnknown command\e[0m: $0 ${getopt}"
+		echo -e "${red}Unknown command${default}: $0 ${getopt}"
 		exitcode=2
 	fi
 	echo "Usage: $0 [option]"
 	echo "${gamename} - Linux Game Server Manager - Version ${version}"
 	echo "https://gameservermanagers.com/${selfname}"
 	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
+	echo -e "${lightyellow}Commands${default}"
 	{
-		echo -e "\e[34mstart\t\e[0mst |Start the server."
-		echo -e "\e[34mstop\t\e[0msp |Stop the server."
-		echo -e "\e[34mrestart\t\e[0mr  |Restart the server."
-		echo -e "\e[34mupdate\t\e[0mu  |Checks and applies updates from SteamCMD."
-		echo -e "\e[34mupdate-functions\t\e[0muf |Removes all functions so latest can be downloaded."
-		echo -e "\e[34mmonitor\t\e[0mm  |Checks that the server is running."
-		echo -e "\e[34mtest-alert\t\e[0mta |Sends test alert."
-		echo -e "\e[34mdetails\t\e[0mdt |Displays useful infomation about the server."
-		echo -e "\e[34mchange-password\t\e[0mpw |Changes TS3 serveradmin password."
-		echo -e "\e[34mbackup\t\e[0mb  |Create archive of the server."
-		echo -e "\e[34minstall\t\e[0mi  |Install the server."
-		echo -e "\e[34mauto-install\t\e[0mai |Install the server, without prompts."
+		echo -e "${blue}start\t${default}st |Start the server."
+		echo -e "${blue}stop\t${default}sp |Stop the server."
+		echo -e "${blue}restart\t${default}r  |Restart the server."
+		echo -e "${blue}update\t${default}u  |Checks and applies updates from SteamCMD."
+		echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
+		echo -e "${blue}monitor\t${default}m  |Checks that the server is running."
+		echo -e "${blue}test-alert\t${default}ta |Sends test alert."
+		echo -e "${blue}details\t${default}dt |Displays useful infomation about the server."
+		echo -e "${blue}change-password\t${default}pw |Changes TS3 serveradmin password."
+		echo -e "${blue}backup\t${default}b  |Create archive of the server."
+		echo -e "${blue}install\t${default}i  |Install the server."
+		echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
 	} | column -s $'\t' -t
 	esac
 }
@@ -156,24 +156,24 @@ case "${getopt}" in
 		command_dev_detect_deps.sh;;
 	*)
 	if [ -n "${getopt}" ]; then
-		echo -e "\e[0;31mUnknown command\e[0m: $0 ${getopt}"
+		echo -e "${red}Unknown command${default}: $0 ${getopt}"
 		exitcode=2
 	fi
 	echo "Usage: $0 [option]"
 	echo "${gamename} - Linux Game Server Manager - Version ${version}"
 	echo "https://gameservermanagers.com/${selfname}"
 	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
+	echo -e "${lightyellow}Commands${default}"
 	{
-		echo -e "\e[34mstart\t\e[0mst |Start the server."
-		echo -e "\e[34mstop\t\e[0msp |Stop the server."
-		echo -e "\e[34mrestart\t\e[0mr  |Restart the server."
-		echo -e "\e[34mupdate-functions\t\e[0muf |Removes all functions so latest can be downloaded."
-		echo -e "\e[34mmonitor\t\e[0mm  |Checks that the server is running."
-		echo -e "\e[34mtest-alert\t\e[0mta |Sends test alert."
-		echo -e "\e[34mbackup\t\e[0mb  |Create archive of the server."
-		echo -e "\e[34mconsole\t\e[0mc  |Console allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0md  |See the output of the server directly to your terminal."
+		echo -e "${blue}start\t${default}st |Start the server."
+		echo -e "${blue}stop\t${default}sp |Stop the server."
+		echo -e "${blue}restart\t${default}r  |Restart the server."
+		echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
+		echo -e "${blue}monitor\t${default}m  |Checks that the server is running."
+		echo -e "${blue}test-alert\t${default}ta |Sends test alert."
+		echo -e "${blue}backup\t${default}b  |Create archive of the server."
+		echo -e "${blue}console\t${default}c  |Console allows you to access the live view of a server."
+		echo -e "${blue}debug\t${default}d  |See the output of the server directly to your terminal."
 	} | column -s $'\t' -t
 	esac
 }
@@ -219,31 +219,31 @@ case "${getopt}" in
 		command_fastdl.sh;;
 	*)
 	if [ -n "${getopt}" ]; then
-		echo -e "\e[0;31mUnknown command\e[0m: $0 ${getopt}"
+		echo -e "${red}Unknown command${default}: $0 ${getopt}"
 		exitcode=2
 	fi
 	echo "Usage: $0 [option]"
 	echo "${gamename} - Linux Game Server Manager - Version ${version}"
 	echo "https://gameservermanagers.com/${selfname}"
 	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
+	echo -e "${lightyellow}Commands${default}"
 	{
-		echo -e "\e[34mstart\t\e[0mst |Start the server."
-		echo -e "\e[34mstop\t\e[0msp |Stop the server."
-		echo -e "\e[34mrestart\t\e[0mr  |Restart the server."
-		echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD."
-		echo -e "\e[34mforce-update\t\e[0mfu |Bypasses the check and applies updates from SteamCMD."
-		echo -e "\e[34mupdate-functions\t\e[0muf |Removes all functions so latest can be downloaded."
-		echo -e "\e[34mvalidate\t\e[0mv  |Validate server files with SteamCMD."
-		echo -e "\e[34mmonitor\t\e[0mm  |Checks that the server is running."
-		echo -e "\e[34mtest-alert\t\e[0mta |Sends test alert."
-		echo -e "\e[34mdetails\t\e[0mdt |Displays useful infomation about the server."
-		echo -e "\e[34mbackup\t\e[0mb  |Create archive of the server."
-		echo -e "\e[34mconsole\t\e[0mc  |Console allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0md  |See the output of the server directly to your terminal."
-		echo -e "\e[34minstall\t\e[0mi  |Install the server."
-		echo -e "\e[34mauto-install\t\e[0mai |Install the server, without prompts."
-		echo -e "\e[34mfastdl\t\e[0mfd |Generates or update a FastDL folder for your server."
+		echo -e "${blue}start\t${default}st |Start the server."
+		echo -e "${blue}stop\t${default}sp |Stop the server."
+		echo -e "${blue}restart\t${default}r  |Restart the server."
+		echo -e "${blue}update\t${default}Checks and applies updates from SteamCMD."
+		echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD."
+		echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
+		echo -e "${blue}validate\t${default}v  |Validate server files with SteamCMD."
+		echo -e "${blue}monitor\t${default}m  |Checks that the server is running."
+		echo -e "${blue}test-alert\t${default}ta |Sends test alert."
+		echo -e "${blue}details\t${default}dt |Displays useful infomation about the server."
+		echo -e "${blue}backup\t${default}b  |Create archive of the server."
+		echo -e "${blue}console\t${default}c  |Console allows you to access the live view of a server."
+		echo -e "${blue}debug\t${default}d  |See the output of the server directly to your terminal."
+		echo -e "${blue}install\t${default}i  |Install the server."
+		echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
+		echo -e "${blue}fastdl\t${default}fd |Generates or update a FastDL folder for your server."
 	} | column -s $'\t' -t
 	esac
 }
@@ -282,28 +282,28 @@ case "${getopt}" in
 		command_dev_detect_deps.sh;;
 	*)
 	if [ -n "${getopt}" ]; then
-		echo -e "\e[0;31mUnknown command\e[0m: $0 ${getopt}"
+		echo -e "${red}Unknown command${default}: $0 ${getopt}"
 		exitcode=2
 	fi
 	echo "Usage: $0 [option]"
 	echo "${gamename} - Linux Game Server Manager - Version ${version}"
 	echo "https://gameservermanagers.com/${selfname}"
 	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
+	echo -e "${lightyellow}Commands${default}"
 	{
-		echo -e "\e[34mstart\t\e[0mst |Start the server."
-		echo -e "\e[34mstop\t\e[0msp |Stop the server."
-		echo -e "\e[34mrestart\t\e[0mr  |Restart the server."
-		echo -e "\e[34mupdate-functions\t\e[0muf |Removes all functions so latest can be downloaded."
-		echo -e "\e[34mmonitor\t\e[0mm  |Checks that the server is running."
-		echo -e "\e[34mtest-alert\t\e[0mta |Sends test alert."
-		echo -e "\e[34mdetails\t\e[0mdt |Displays useful infomation about the server."
-		echo -e "\e[34mbackup\t\e[0mb  |Create archive of the server."
-		echo -e "\e[34mconsole\t\e[0mc  |Console allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0md  |See the output of the server directly to your terminal."
-		echo -e "\e[34minstall\t\e[0mi  |Install the server."
-		echo -e "\e[34mauto-install\t\e[0mai |Install the server, without prompts."
-		echo -e "\e[34mmap-compressor\t\e[0mmc |Compresses all ${gamename} server maps."
+		echo -e "${blue}start\t${default}st |Start the server."
+		echo -e "${blue}stop\t${default}sp |Stop the server."
+		echo -e "${blue}restart\t${default}r  |Restart the server."
+		echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
+		echo -e "${blue}monitor\t${default}m  |Checks that the server is running."
+		echo -e "${blue}test-alert\t${default}ta |Sends test alert."
+		echo -e "${blue}details\t${default}dt |Displays useful infomation about the server."
+		echo -e "${blue}backup\t${default}b  |Create archive of the server."
+		echo -e "${blue}console\t${default}c  |Console allows you to access the live view of a server."
+		echo -e "${blue}debug\t${default}d  |See the output of the server directly to your terminal."
+		echo -e "${blue}install\t${default}i  |Install the server."
+		echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
+		echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps."
 	} | column -s $'\t' -t
 	esac
 }
@@ -350,31 +350,31 @@ case "${getopt}" in
 		compress_unreal2_maps.sh;;
 	*)
 	if [ -n "${getopt}" ]; then
-		echo -e "\e[0;31mUnknown command\e[0m: $0 ${getopt}"
+		echo -e "${red}Unknown command${default}: $0 ${getopt}"
 		exitcode=2
 	fi
 	echo "Usage: $0 [option]"
 	echo "${gamename} - Linux Game Server Manager - Version ${version}"
 	echo "https://gameservermanagers.com/${selfname}"
 	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
+	echo -e "${lightyellow}Commands${default}"
 	{
-		echo -e "\e[34mstart\t\e[0mst |Start the server."
-		echo -e "\e[34mstop\t\e[0msp |Stop the server."
-		echo -e "\e[34mrestart\t\e[0mr  |Restart the server."
-		echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD."
-		echo -e "\e[34mforce-update\t\e[0mfu |Bypasses the check and applies updates from SteamCMD."
-		echo -e "\e[34mupdate-functions\t\e[0muf |Removes all functions so latest can be downloaded."
-		echo -e "\e[34mvalidate\t\e[0mv  |Validate server files with SteamCMD."
-		echo -e "\e[34mmonitor\t\e[0mm  |Checks that the server is running."
-		echo -e "\e[34mtest-alert\t\e[0mta |Sends test alert."
-		echo -e "\e[34mdetails\t\e[0mdt |Displays useful infomation about the server."
-		echo -e "\e[34mbackup\t\e[0mb  |Create archive of the server."
-		echo -e "\e[34mconsole\t\e[0mc  |Console allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0md  |See the output of the server directly to your terminal."
-		echo -e "\e[34minstall\t\e[0mi  |Install the server."
-		echo -e "\e[34mauto-install\t\e[0mai |Install the server, without prompts."
-		echo -e "\e[34mmap-compressor\t\e[0mmc |Compresses all ${gamename} server maps."
+		echo -e "${blue}start\t${default}st |Start the server."
+		echo -e "${blue}stop\t${default}sp |Stop the server."
+		echo -e "${blue}restart\t${default}r  |Restart the server."
+		echo -e "${blue}update\t${default}Checks and applies updates from SteamCMD."
+		echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD."
+		echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
+		echo -e "${blue}validate\t${default}v  |Validate server files with SteamCMD."
+		echo -e "${blue}monitor\t${default}m  |Checks that the server is running."
+		echo -e "${blue}test-alert\t${default}ta |Sends test alert."
+		echo -e "${blue}details\t${default}dt |Displays useful infomation about the server."
+		echo -e "${blue}backup\t${default}b  |Create archive of the server."
+		echo -e "${blue}console\t${default}c  |Console allows you to access the live view of a server."
+		echo -e "${blue}debug\t${default}d  |See the output of the server directly to your terminal."
+		echo -e "${blue}install\t${default}i  |Install the server."
+		echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
+		echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps."
 	} | column -s $'\t' -t
 	esac
 }
@@ -416,29 +416,29 @@ case "${getopt}" in
 		command_dev_detect_deps.sh;;
 	*)
 	if [ -n "${getopt}" ]; then
-		echo -e "\e[0;31mUnknown command\e[0m: $0 ${getopt}"
+		echo -e "${red}Unknown command${default}: $0 ${getopt}"
 		exitcode=2
 	fi
 	echo "Usage: $0 [option]"
 	echo "${gamename} - Linux Game Server Manager - Version ${version}"
 	echo "https://gameservermanagers.com/${selfname}"
 	echo -e ""
-	echo -e "\e[93mCommands\e[0m"
+	echo -e "${lightyellow}Commands${default}"
 	{
-		echo -e "\e[34mstart\t\e[0mst |Start the server."
-		echo -e "\e[34mstop\t\e[0msp |Stop the server."
-		echo -e "\e[34mrestart\t\e[0mr  |Restart the server."
-		echo -e "\e[34mupdate-functions\t\e[0muf |Removes all functions so latest can be downloaded."
-		echo -e "\e[34mmonitor\t\e[0mm  |Checks that the server is running."
-		echo -e "\e[34mtest-alert\t\e[0mta |Sends test alert."
-		echo -e "\e[34mdetails\t\e[0mdt |Displays useful infomation about the server."
-		echo -e "\e[34mbackup\t\e[0mb  |Create archive of the server."
-		echo -e "\e[34mconsole\t\e[0mc  |Console allows you to access the live view of a server."
-		echo -e "\e[34mdebug\t\e[0md  |See the output of the server directly to your terminal."
-		echo -e "\e[34minstall\t\e[0mi  |Install the server."
-		echo -e "\e[34mauto-install\t\e[0mai |Install the server, without prompts."
-		echo -e "\e[34mserver-cd-key\t\e[0mcd |Add your server cd key"
-		echo -e "\e[34mmap-compressor\t\e[0mmc |Compresses all ${gamename} server maps."
+		echo -e "${blue}start\t${default}st |Start the server."
+		echo -e "${blue}stop\t${default}sp |Stop the server."
+		echo -e "${blue}restart\t${default}r  |Restart the server."
+		echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
+		echo -e "${blue}monitor\t${default}m  |Checks that the server is running."
+		echo -e "${blue}test-alert\t${default}ta |Sends test alert."
+		echo -e "${blue}details\t${default}dt |Displays useful infomation about the server."
+		echo -e "${blue}backup\t${default}b  |Create archive of the server."
+		echo -e "${blue}console\t${default}c  |Console allows you to access the live view of a server."
+		echo -e "${blue}debug\t${default}d  |See the output of the server directly to your terminal."
+		echo -e "${blue}install\t${default}i  |Install the server."
+		echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
+		echo -e "${blue}server-cd-key\t${default}cd |Add your server cd key"
+		echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps."
 	} | column -s $'\t' -t
 	esac
 }

+ 63 - 52
lgsm/functions/core_messages.sh

@@ -7,6 +7,17 @@
 # nl: new line: message is following by a new line
 # eol: end of line: message is placed at the end of the current line
 
+if [ "${ansi}" != "off" ]; then
+	# echo colors
+	default="\e[0m"
+	red="\e[31m"
+	green="\e[32m"
+	yellow="\e[33m"
+	blue="\e[34m"
+	magenta="\e[35m"
+	cyan="\e[36m"
+	lightyellow="\e[93m"
+fi
 
 # Log display
 ##########
@@ -74,17 +85,17 @@ fn_script_log_info(){
 # [ .... ]
 fn_print_dots(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[ .... ] ${commandaction} ${servicename}: $@"
+		echo -en "\r[ .... ] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[ .... ] $@"
+		echo -en "\r[ .... ] $@"
 	fi
 }
 
 fn_print_dots_nl(){
 	if [ -n "${commandaction}" ]; then
-		echo -e "\r\033[K[ .... ] ${commandaction} ${servicename}: $@"
+		echo -e "\r[ .... ] ${commandaction} ${servicename}: $@"
 	else
-		echo -e "\r\033[K[ .... ] $@"
+		echo -e "\r[ .... ] $@"
 	fi
 	sleep 0.5
 	echo -en "\n"
@@ -93,17 +104,17 @@ fn_print_dots_nl(){
 # [  OK  ]
 fn_print_ok(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[\e[0;32m  OK  \e[0m] ${commandaction} ${servicename}: $@"
+		echo -en "\r[${green}  OK  ${default}] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[\e[0;32m  OK  \e[0m] $@"
+		echo -en "\r[${green}  OK  ${default}] $@"
 	fi
 }
 
 fn_print_ok_nl(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[\e[0;32m  OK  \e[0m] ${commandaction} ${servicename}: $@"
+		echo -en "\r[${green}  OK  ${default}] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[\e[0;32m  OK  \e[0m] $@"
+		echo -en "\r[${green}  OK  ${default}] $@"
 	fi
 	sleep 0.5
 	echo -en "\n"
@@ -112,17 +123,17 @@ fn_print_ok_nl(){
 # [ FAIL ]
 fn_print_fail(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[\e[0;31m FAIL \e[0m] ${commandaction} ${servicename}: $@"
+		echo -en "\r[${red} FAIL ${default}] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[\e[0;31m FAIL \e[0m] $@"
+		echo -en "\r[${red} FAIL ${default}] $@"
 	fi
 }
 
 fn_print_fail_nl(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[\e[0;31m FAIL \e[0m] ${commandaction} ${servicename}: $@"
+		echo -en "\r[${red} FAIL ${default}] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[\e[0;31m FAIL \e[0m] $@"
+		echo -en "\r[${red} FAIL ${default}] $@"
 	fi
 	sleep 0.5
 	echo -en "\n"
@@ -131,17 +142,17 @@ fn_print_fail_nl(){
 # [ ERROR ]
 fn_print_error(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[\e[0;31m ERROR \e[0m] ${commandaction} ${servicename}: $@"
+		echo -en "\r[${red} ERROR ${default}] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[\e[0;31m ERROR \e[0m] $@"
+		echo -en "\r[${red} ERROR ${default}] $@"
 	fi
 }
 
 fn_print_error_nl(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[\e[0;31m ERROR \e[0m] ${commandaction} ${servicename}: $@"
+		echo -en "\r[${red} ERROR ${default}] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[\e[0;31m ERROR \e[0m] $@"
+		echo -en "\r[${red} ERROR ${default}] $@"
 	fi
 	sleep 0.5
 	echo -en "\n"
@@ -150,17 +161,17 @@ fn_print_error_nl(){
 # [ WARN ]
 fn_print_warn(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[\e[1;33m WARN \e[0m] ${commandaction} ${servicename}: $@"
+		echo -en "\r[${yellow} WARN ${default}] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[\e[1;33m WARN \e[0m] $@"
+		echo -en "\r[${yellow} WARN ${default}] $@"
 	fi
 }
 
 fn_print_warn_nl(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[\e[1;33m WARN \e[0m] ${commandaction} ${servicename}: $@"
+		echo -en "\r[${yellow} WARN ${default}] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[\e[1;33m WARN \e[0m] $@"
+		echo -en "\r[${yellow} WARN ${default}] $@"
 	fi
 	sleep 0.5
 	echo -en "\n"
@@ -169,17 +180,17 @@ fn_print_warn_nl(){
 # [ INFO ]
 fn_print_info(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[\e[0;36m INFO \e[0m] ${commandaction} ${servicename}: $@"
+		echo -en "\r[${cyan} INFO ${default}] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[\e[0;36m INFO \e[0m] $@"
+		echo -en "\r[${cyan} INFO ${default}] $@"
 	fi
 }
 
 fn_print_info_nl(){
 	if [ -n "${commandaction}" ]; then
-		echo -en "\r\033[K[\e[0;36m INFO \e[0m] ${commandaction} ${servicename}: $@"
+		echo -en "\r[${cyan} INFO ${default}] ${commandaction} ${servicename}: $@"
 	else
-		echo -en "\r\033[K[\e[0;36m INFO \e[0m] $@"
+		echo -en "\r[${cyan} INFO ${default}] $@"
 	fi
 	sleep 0.5
 	echo -en "\n"
@@ -190,47 +201,47 @@ fn_print_info_nl(){
 
 # Complete!
 fn_print_complete(){
-	echo -en "\e[0;32mComplete!\e[0m $@"
+	echo -en "${green}Complete!${default} $@"
 }
 
 fn_print_complete_nl(){
-	echo -e "\e[0;32mComplete!\e[0m $@"
+	echo -e "${green}Complete!${default} $@"
 }
 
 # Failure!
 fn_print_failure(){
-	echo -en "\e[0;31mFailure!\e[0m $@"
+	echo -en "${red}Failure!${default} $@"
 }
 
 fn_print_failure_nl(){
-	echo -e "\e[0;31mFailure!\e[0m $@"
+	echo -e "${red}Failure!${default} $@"
 }
 
 # Error!
 fn_print_error(){
-	echo -en "\e[0;31mError!\e[0m $@"
+	echo -en "${red}Error!${default} $@"
 }
 
 fn_print_error_nl(){
-	echo -e "\e[0;31mError!\e[0m $@"
+	echo -e "${red}Error!${default} $@"
 }
 
 # Warning!
 fn_print_warning(){
-	echo -en "\e[0;33mWarning!\e[0m $@"
+	echo -en "${yellow}Warning!${default} $@"
 }
 
 fn_print_warning_nl(){
-	echo -e "\e[0;33mWarning!\e[0m $@"
+	echo -e "${yellow}Warning!${default} $@"
 }
 
 # Infomation!
 fn_print_infomation(){
-	echo -en "\e[0;36mInfomation!\e[0m $@"
+	echo -en "${cyan}Infomation!${default} $@"
 }
 
 fn_print_infomation_nl(){
-	echo -e "\e[0;36mInfomation!\e[0m $@"
+	echo -e "${cyan}Infomation!${default} $@"
 }
 
 # On-Screen End of Line
@@ -238,81 +249,81 @@ fn_print_infomation_nl(){
 
 # OK
 fn_print_ok_eol(){
-	echo -en "\e[0;32mOK\e[0m"
+	echo -en "${green}OK${default}"
 }
 
 fn_print_ok_eol_nl(){
-	echo -e "\e[0;32mOK\e[0m"
+	echo -e "${green}OK${default}"
 }
 
 # FAIL
 fn_print_fail_eol(){
-	echo -en "\e[0;31mFAIL\e[0m"
+	echo -en "${red}FAIL${default}"
 }
 
 fn_print_fail_eol_nl(){
-	echo -e "\e[0;31mFAIL\e[0m"
+	echo -e "${red}FAIL${default}"
 }
 
 # WARN
 fn_print_warn_eol(){
-	echo -en "\e[0;31mFAIL\e[0m"
+	echo -en "${red}FAIL${default}"
 }
 
 fn_print_warn_eol_nl(){
-	echo -e "\e[0;31mFAIL\e[0m"
+	echo -e "${red}FAIL${default}"
 }
 
 # INFO
 fn_print_info_eol(){
-	echo -en "\e[0;31mFAIL\e[0m"
+	echo -en "${red}FAIL${default}"
 }
 
 fn_print_info_eol_nl(){
-	echo -e "\e[0;31mFAIL\e[0m"
+	echo -e "${red}FAIL${default}"
 }
 
 # QUERYING
 fn_print_querying_eol(){
-	echo -en "\e[0;36mQUERYING\e[0m"
+	echo -en "${cyan}QUERYING${default}"
 }
 
 fn_print_querying_eol_nl(){
-	echo -e "\e[0;36mQUERYING\e[0m"
+	echo -e "${cyan}QUERYING${default}"
 }
 
 # CHECKING
 fn_print_checking_eol(){
-	echo -en "\e[0;36mCHECKING\e[0m"
+	echo -en "${cyan}CHECKING${default}"
 }
 
 fn_print_checking_eol_nl(){
-	echo -e "\e[0;36mCHECKING\e[0m"
+	echo -e "${cyan}CHECKING${default}"
 }
 
 # CANCELED
 fn_print_canceled_eol(){
-	echo -en "\e[0;33mCANCELED\e[0m"
+	echo -en "${yellow}CANCELED${default}"
 }
 
 fn_print_canceled_eol_nl(){
-	echo -e "\e[0;33mCANCELED\e[0m"
+	echo -e "${yellow}CANCELED${default}"
 }
 
 # REMOVED
 fn_print_removed_eol(){
-	echo -en "\e[0;31mREMOVED\e[0m"
+	echo -en "${red}REMOVED${default}"
 }
 
 fn_print_removed_eol_nl(){
-	echo -e "\e[0;31mREMOVED\e[0m"
+	echo -e "${red}REMOVED${default}"
 }
 
 # UPDATE
 fn_print_update_eol(){
-	echo -en "\e[0;36mUPDATE\e[0m"
+	echo -en "${cyan}UPDATE${default}"
 }
 
 fn_print_update_eol_nl(){
-	echo -e "\e[0;36mUPDATE\e[0m"
+	echo -e "${cyan}UPDATE${default}"
 }

+ 2 - 2
lgsm/functions/info_config.sh

@@ -12,8 +12,8 @@ local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 # tr -d '=\"; ' remove selected charectors =\";
 # grep -v "foo" filter out lines that contain foo
 
-unavailable="\e[0;31mUNAVAILABLE\e[0m"
-zero="\e[0;31m0\e[0m"
+unavailable="${red}UNAVAILABLE${default}"
+zero="${red}0${default}"
 
 fn_info_config_avalanche(){
 	if [ ! -f "${servercfgfullpath}" ]; then

+ 1 - 1
lgsm/functions/info_distro.sh

@@ -30,7 +30,7 @@ glibcversion="$(ldd --version | sed -n '1s/.* //p')"
 ## tmux version
 # e.g: tmux 1.6
 if [ -z "$(command -v tmux)" ]; then
-	tmuxv="\e[0;31mNOT INSTALLED!\e[0m"
+	tmuxv="${red}NOT INSTALLED!${default}"
 elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then
 	tmuxv="$(tmux -V) (>= 1.6 required for console log)"
 else

+ 2 - 2
lgsm/functions/info_parms.sh

@@ -12,8 +12,8 @@ local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 # tr -d '=\"; ' remove selected charectors =\";
 # grep -v "foo" filter out lines that contain foo
 
-unavailable="\e[0;31mUNAVAILABLE\e[0m"
-zero="\e[0;31m0\e[0m"
+unavailable="${red}UNAVAILABLE${default}"
+zero="${red}0${default}"
 
 
 fn_info_config_idtech3(){

+ 1 - 1
lgsm/functions/monitor_gsquery.sh

@@ -79,7 +79,7 @@ if [ "${gsquery}" == "yes" ]; then
 
 			# Seconds counter
 			for seconds in {1..15}; do
-				fn_print_fail "Querying port: ${ip}:${port} : ${totalseconds}/${queryattempt} : \e[0;31m${gsquerycmd}\e[0m"
+				fn_print_fail "Querying port: ${ip}:${port} : ${totalseconds}/${queryattempt} : ${red}${gsquerycmd}${default}"
 				totalseconds=$((totalseconds + 1))
 				sleep 1
 				if [ "${seconds}" == "15" ]; then

+ 8 - 8
lgsm/functions/update_check.sh

@@ -149,8 +149,8 @@ fn_steamcmdcheck(){
 		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 "	Current build: ${red}${currentbuild}${default}"
+		echo -e "	Available build: ${green}${availablebuild}${default}"
 		echo -e ""
 		echo -e "	https://steamdb.info/app/${appid}/"
 		sleep 1
@@ -181,8 +181,8 @@ fn_steamcmdcheck(){
 	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 "	Current version: ${green}${currentbuild}${default}"
+		echo -e "	Available version: ${green}${availablebuild}${default}"
 		echo -e "	https://steamdb.info/app/${appid}/"
 		echo -e ""
 		fn_print_ok_nl "No update available"
@@ -279,8 +279,8 @@ fn_teamspeak3_check(){
 		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 "	Current build: ${red}${currentbuild} ${architecture}${default}"
+		echo -e "	Available build: ${green}${availablebuild} ${architecture}${default}"
 		echo -e ""
 		sleep 1
 		echo ""
@@ -313,8 +313,8 @@ fn_teamspeak3_check(){
 	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 "	Current version: ${green}${currentbuild}${default}"
+		echo -e "	Available version: ${green}${availablebuild}${default}"
 		echo -e ""
 		fn_print_ok_nl "No update available"
 		fn_script_log "Current build: ${currentbuild}"

+ 4 - 4
lgsm/functions/update_steamcmd.sh

@@ -171,8 +171,8 @@ fn_update_steamcmd_check(){
 		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 "	Current build: ${red}${currentbuild}${default}"
+		echo -e "	Available build: ${green}${availablebuild}${default}"
 		echo -e ""
 		echo -e "	https://steamdb.info/app/${appid}/"
 		sleep 1
@@ -205,8 +205,8 @@ fn_update_steamcmd_check(){
 	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 "	Current version: ${green}${currentbuild}${default}"
+		echo -e "	Available version: ${green}${availablebuild}${default}"
 		echo -e "	https://steamdb.info/app/${appid}/"
 		echo -e ""
 		fn_print_ok_nl "No update available"

+ 4 - 4
lgsm/functions/update_ts3.sh

@@ -119,8 +119,8 @@ fn_update_ts3_compare(){
 		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 "	Current build: ${red}${currentbuild} ${architecture}${default}"
+		echo -e "	Available build: ${green}${availablebuild} ${architecture}${default}"
 		echo -e ""
 		sleep 1
 		echo ""
@@ -157,8 +157,8 @@ fn_update_ts3_compare(){
 	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 "	Current version: ${green}${currentbuild}${default}"
+		echo -e "	Available version: ${green}${availablebuild}${default}"
 		echo -e ""
 		fn_print_ok_nl "No update available"
 		fn_script_log_info "Current build: ${currentbuild}"