Przeglądaj źródła

Added warning if config file missing

Daniel Gibbs 11 lat temu
rodzic
commit
6ba8acdd2e
1 zmienionych plików z 16 dodań i 6 usunięć
  1. 16 6
      functions/fn_details

+ 16 - 6
functions/fn_details

@@ -2,7 +2,7 @@
 # LGSM fn_details function
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
-# Version: 060715
+# Version: 100715
 
 # Description: Displays server infomation.
 
@@ -56,11 +56,6 @@ rm -f .fn_details_disk
 }
 
 fn_details_gameserver(){
-if [ ! -e ${servercfgfullpath} ]; then
-	servername="\e[0;31mCONFIG FILE MISSING!\e[0m"
-	rcon="\e[0;31mCONFIG FILE MISSING!\e[0m"
-	servercfgfullpath="${servercfgfullpath} \e[0;31mCONFIG FILE MISSING!!\e[0m"
-fi
 echo -e ""
 echo -e "\e[92m${gamename} Server Details\e[0m"
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
@@ -520,6 +515,21 @@ rm -f .fn_details_ports
 fn_details_statusbottom
 }
 
+if [ ! -e ${servercfgfullpath} ]; then
+	echo ""
+	fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m"
+	echo "${servercfgfullpath}"
+	echo "Some details cannot be displayed"
+
+	echo -en ".\r"
+	sleep 1
+	echo -en "..\r"
+	sleep 1
+	echo -en "...\r"
+	sleep 1
+	echo -en "   \r"
+fi
+
 if [ "${engine}" == "avalanche" ]; then
 	fn_details_avalanche
 elif [ "${engine}" == "dontstarve" ]; then