Răsfoiți Sursa

fixed rconport and rconpassword being the same var

Daniel Gibbs 10 ani în urmă
părinte
comite
a8c4603d7e
2 a modificat fișierele cu 13 adăugiri și 20 ștergeri
  1. 2 2
      functions/fn_details
  2. 11 18
      functions/fn_details_config

+ 2 - 2
functions/fn_details

@@ -77,8 +77,8 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	echo -e "\e[34mServer IP:\t\e[0m${ip}:${port}"
 	echo -e "\e[34mServer IP:\t\e[0m${ip}:${port}"
 
 
 	# rcon password
 	# rcon password
-	if [ -n "${rcon}" ]; then
-		echo -e "\e[34mRCON password:\t\e[0m${rcon}"
+	if [ -n "${rconpassword}" ]; then
+		echo -e "\e[34mRCON password:\t\e[0m${rconpassword}"
 	fi
 	fi
 
 
 	# server password
 	# server password

+ 11 - 18
functions/fn_details_config

@@ -2,7 +2,7 @@
 # LGSM fn_details_config function
 # LGSM fn_details_config function
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
-# Version: 141015
+# Version: 281015
 
 
 # Description: Gets specific details from config files.
 # Description: Gets specific details from config files.
 
 
@@ -249,9 +249,9 @@ elif [ "${engine}" == "seriousengine35" ]; then
 
 
 	# rcon password
 	# rcon password
 	if [ -f "${servercfgfullpath}" ]; then
 	if [ -f "${servercfgfullpath}" ]; then
-		rcon=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed 's/rcts_strAdminPassword = //g' | tr -d '=\"; ')
-		if [ ! -n "${rcon}" ]; then
-			rcon="NOT SET"
+		rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed 's/rcts_strAdminPassword = //g' | tr -d '=\"; ')
+		if [ ! -n "${rconpassword}" ]; then
+			rconpassword="NOT SET"
 		fi
 		fi
 	else
 	else
 		servername="\e[0;31mUNAVAILABLE\e[0m"
 		servername="\e[0;31mUNAVAILABLE\e[0m"
@@ -319,12 +319,12 @@ elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsource" ]; then
 
 
 	# rcon password
 	# rcon password
 	if [ -f "${servercfgfullpath}" ]; then
 	if [ -f "${servercfgfullpath}" ]; then
-		rcon=$(grep "rcon_password" "${servercfgfullpath}" | sed 's/rcon_password //g' | sed 's/"//g')
-		if [ ! -n "${rcon}" ]; then
-			rcon="NOT SET"
+		rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed 's/rcon_password //g' | sed 's/"//g')
+		if [ ! -n "${rconpassword}" ]; then
+			rconpassword="NOT SET"
 		fi
 		fi
 	else
 	else
-		rcon="\e[0;31mUNAVAILABLE\e[0m"
+		rconpassword="\e[0;31mUNAVAILABLE\e[0m"
 	fi
 	fi
 
 
 elif [ "${engine}" == "spark" ]; then
 elif [ "${engine}" == "spark" ]; then
@@ -382,13 +382,6 @@ elif [ "${gamename}" == "Teamspeak 3" ]; then
 		fileport="30033"
 		fileport="30033"
 	fi
 	fi
 
 
-elif [ "${engine}" == "teeworlds" ]; then
-
-	# port
-	if [ -f "${servercfgfullpath}" ]; then
-		port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd "[:digit:]")
-	fi
-	
 elif [ "${engine}" == "terraria" ]; then
 elif [ "${engine}" == "terraria" ]; then
 
 
 	# port
 	# port
@@ -712,10 +705,10 @@ elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
 
 
 	# rcon port
 	# rcon port
 	if [ -f "${servercfgfullpath}" ]; then
 	if [ -f "${servercfgfullpath}" ]; then
-		rcon=$(grep "RCONPort=" "${servercfgfullpath}" | tr -cd "[:digit:]")
+		rconport=$(grep "RCONPort=" "${servercfgfullpath}" | tr -cd "[:digit:]")
 	fi
 	fi
-	if [ ! -n "${rcon}" ]; then
-		rcon="0"
+	if [ ! -n "${rconport}" ]; then
+		rconport="0"
 	fi
 	fi
 
 
 	# query port
 	# query port