Browse Source

improvements to squad details

pull/1601/head
Daniel Gibbs 8 years ago
parent
commit
447c30c318
  1. 19
      lgsm/functions/info_config.sh

19
lgsm/functions/info_config.sh

@ -753,20 +753,25 @@ fn_info_config_squad(){
servername="${unavailable}" servername="${unavailable}"
maxplayers="${unavailable}" maxplayers="${unavailable}"
else else
servername="$(cat ${servercfgfullpath} | grep "ServerName=" | cut -c13- | rev | cut -c3- | rev)" servername="$(cat ${servercfgfullpath} | grep "ServerName=" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')"
maxplayers="$(cat ${servercfgfullpath} | grep "MaxPlayers=" | cut -c12- | tr -cd '[:digit:]')" maxplayers="$(cat ${servercfgfullpath} | grep "MaxPlayers=" | tr -cd '[:digit:]')"
fi fi
if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then
rconport=${unavailable} rconport=${unavailable}
rconpassword=${unavailable} rconpassword=${unavailable}
else else
rconport=$(cat ${servercfgdir}/Rcon.cfg | grep "Port=" | cut -c6- | tr -cd '[:digit:]') rconport=$(cat ${servercfgdir}/Rcon.cfg | grep "Port=" | tr -cd '[:digit:]')
rconpassword=$(cat ${servercfgdir}/Rcon.cfg | grep "Password=" | cut -c10-) rconpassword=$(cat ${servercfgdir}/Rcon.cfg | grep "Password=" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then fi
rconpassword="${yellow}DISABLED${default}"
fi rconport=${rconport:-"0"}
if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then
rconpassword="NOT SET"
fi fi
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
} }
# Just Cause 2 # Just Cause 2

Loading…
Cancel
Save