소스 검색

server password working

Daniel Gibbs 10 년 전
부모
커밋
0e7343b933
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  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