Explorar o código

server password working

Daniel Gibbs %!s(int64=10) %!d(string=hai) anos
pai
achega
0e7343b933
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      functions/info_config.sh

+ 10 - 0
functions/info_config.sh

@@ -168,6 +168,16 @@ elif [ "${engine}" == "idtech3" ]; then
 		servername="\e[0;31mUNAVAILABLE\e[0m"
 	fi
 
+	# server password
+	if [ -f "${servercfgfullpath}" ]; then
+		serverpassword=$(grep "set g_password" "${servercfgfullpath}" | grep -v "//" | sed -e 's/set g_password//g' | tr -d '=\"; ')
+		if [ ! -n "${serverpassword}" ]; then
+			serverpassword="NOT SET"
+		fi
+	else
+		serverpassword="\e[0;31mUNAVAILABLE\e[0m"
+	fi
+
 	# rcon password
 	rconpassword="${rconpassword}"
 	if [ -f "${servercfgfullpath}" ]; then