diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 18f772050..22b7520af 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -608,7 +608,17 @@ fn_info_config_unreal(){ } fn_info_config_unreal3(){ - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + webadminpass=$(grep grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi } fn_info_config_sdtd(){