Browse Source

Changed slots to Maxplayers #1036

see issue #1036
pull/1227/head
Daniel Gibbs 8 years ago
parent
commit
012e37640c
  1. 8
      lgsm/functions/alert_email.sh
  2. 8
      lgsm/functions/command_details.sh
  3. 90
      lgsm/functions/info_config.sh
  4. 6
      lgsm/functions/info_parms.sh

8
lgsm/functions/alert_email.sh

@ -100,7 +100,7 @@ fn_details_gameserver(){
# Server IP: 1.2.3.4:27960 # Server IP: 1.2.3.4:27960
# RCON password: CHANGE_ME # RCON password: CHANGE_ME
# Server password: NOT SET # Server password: NOT SET
# Slots: 16 # Maxplayers: 16
# Status: OFFLINE # Status: OFFLINE
{ {
@ -133,9 +133,9 @@ fn_details_gameserver(){
echo -e "Stats password: ********" echo -e "Stats password: ********"
fi fi
# Slots # Maxplayers
if [ -n "${slots}" ]; then if [ -n "${maxplayers}" ]; then
echo -e "Slots: ${slots}" echo -e "Maxplayers: ${slots}"
fi fi
# Game mode # Game mode

8
lgsm/functions/command_details.sh

@ -98,7 +98,7 @@ fn_details_gameserver(){
# Server IP: 1.2.3.4:27960 # Server IP: 1.2.3.4:27960
# RCON password: CHANGE_ME # RCON password: CHANGE_ME
# Server password: NOT SET # Server password: NOT SET
# Slots: 16 # Maxplayers: 16
# Status: OFFLINE # Status: OFFLINE
echo -e "" echo -e ""
@ -133,9 +133,9 @@ fn_details_gameserver(){
echo -e "${blue}Stats password:\t${default}${statspassword}" echo -e "${blue}Stats password:\t${default}${statspassword}"
fi fi
# Slots # Maxplayers
if [ -n "${slots}" ]; then if [ -n "${maxplayers}" ]; then
echo -e "${blue}Slots:\t${default}${slots}" echo -e "${blue}Maxplayers:\t${default}${slots}"
fi fi
# Game mode # Game mode

90
lgsm/functions/info_config.sh

@ -18,13 +18,13 @@ fn_info_config_avalanche(){
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}" servername="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
slots="${zero}" maxplayers="${zero}"
port="${zero}" port="${zero}"
else else
servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
slots=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
ip=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') ip=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
@ -34,7 +34,7 @@ fn_info_config_avalanche(){
# Not Set # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"}
slots=${slots:-"0"} maxplayers=${maxplayers:-"0"}
port=${port:-"0"} port=${port:-"0"}
fi fi
} }
@ -43,14 +43,14 @@ fn_info_config_bf1942(){
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}" servername="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
slots="${zero}" maxplayers="${zero}"
port="${zero}" port="${zero}"
queryport="${zero}" queryport="${zero}"
else else
servername=$(grep "game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs) servername=$(grep "game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs)
serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs)
slots=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
queryport="22000" queryport="22000"
@ -61,7 +61,7 @@ fn_info_config_bf1942(){
# Not Set # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"}
slots=${slots:-"0"} maxplayers=${maxplayers:-"0"}
port=${port:-"0"} port=${port:-"0"}
fi fi
} }
@ -112,14 +112,14 @@ fn_info_config_dontstarve(){
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}" servername="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
slots="${zero}" maxplayers="${zero}"
gamemode="${unavailable}" gamemode="${unavailable}"
tickrate="${zero}" tickrate="${zero}"
port="${zero}" port="${zero}"
else else
servername=$(grep "default_server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/default_server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "default_server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/default_server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
slots=$(grep "max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') maxplayers=$(grep "max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
gamemode=$(grep "game_mode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') gamemode=$(grep "game_mode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
tickrate=$(grep "tick_rate" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') tickrate=$(grep "tick_rate" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
port=$(grep "server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port=$(grep "server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
@ -127,7 +127,7 @@ fn_info_config_dontstarve(){
# Not Set # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"}
slots=${slots:-"0"} maxplayers=${maxplayers:-"0"}
gamemode=${gamemode:-"NOT SET"} gamemode=${gamemode:-"NOT SET"}
tickrate=${tickrate:-"0"} tickrate=${tickrate:-"0"}
port=${port:-"0"} port=${port:-"0"}
@ -139,7 +139,7 @@ fn_info_config_minecraft(){
servername="${unavailable}" servername="${unavailable}"
rconpassword="${unavailable}" rconpassword="${unavailable}"
rconport="${zero}" rconport="${zero}"
slots="${zero}" maxplayers="${zero}"
port="${zero}" port="${zero}"
gamemode="${unavailable}" gamemode="${unavailable}"
gameworld="${unavailable}" gameworld="${unavailable}"
@ -147,7 +147,7 @@ fn_info_config_minecraft(){
servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
slots=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
@ -160,7 +160,7 @@ fn_info_config_minecraft(){
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
rconpassword=${rconpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"}
rconport=${rconport:-"NOT SET"} rconport=${rconport:-"NOT SET"}
slots=${slots:-"NOT SET"} maxplayers=${maxplayers:-"NOT SET"}
port=${port:-"NOT SET"} port=${port:-"NOT SET"}
gamemode=${gamemode:-"NOT SET"} gamemode=${gamemode:-"NOT SET"}
gameworld=${gameworld:-"NOT SET"} gameworld=${gameworld:-"NOT SET"}
@ -173,14 +173,14 @@ fn_info_config_projectzomboid(){
servername="${unavailable}" servername="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
rconpassword="${unavailable}" rconpassword="${unavailable}"
slots="${zero}" maxplayers="${zero}"
port="${zero}" port="${zero}"
gameworld="${unavailable}" gameworld="${unavailable}"
else else
servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
slots=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]') port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
@ -188,7 +188,7 @@ fn_info_config_projectzomboid(){
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"}
rconpassword=${rconpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"}
slots=${slots:-"NOT SET"} maxplayers=${maxplayers:-"NOT SET"}
port=${port:-"NOT SET"} port=${port:-"NOT SET"}
gameworld=${gameworld:-"NOT SET"} gameworld=${gameworld:-"NOT SET"}
fi fi
@ -199,16 +199,16 @@ fn_info_config_quake2(){
rconpassword="${unavailable}" rconpassword="${unavailable}"
servername="${unavailable}" servername="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
slots="${zero}" maxplayers="${zero}"
else else
rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
slots=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
# Not Set # Not Set
rconpassword=${rconpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"}
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
slots=${slots:-"0"} maxplayers=${maxplayers:-"0"}
fi fi
} }
@ -217,18 +217,18 @@ fn_info_config_quake3(){
rconpassword="${unavailable}" rconpassword="${unavailable}"
servername="${unavailable}" servername="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
slots="${zero}" maxplayers="${zero}"
else else
rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
slots=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
# Not Set # Not Set
rconpassword=${rconpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"}
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"}
slots=${slots:-"0"} maxplayers=${maxplayers:-"0"}
fi fi
} }
@ -237,12 +237,12 @@ fn_info_config_quakelive(){
rconpassword="${unavailable}" rconpassword="${unavailable}"
servername="${unavailable}" servername="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
slots="${zero}" maxplayers="${zero}"
else else
rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
slots=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') maxplayers=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
ipsetinconfig=1 ipsetinconfig=1
@ -252,7 +252,7 @@ fn_info_config_quakelive(){
rconpassword=${rconpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"}
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"}
slots=${slots:-"0"} maxplayers=${maxplayers:-"0"}
fi fi
} }
@ -261,14 +261,14 @@ fn_info_config_wolfensteinenemyterritory(){
rconpassword="${unavailable}" rconpassword="${unavailable}"
servername="${unavailable}" servername="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
slots="${zero}" maxplayers="${zero}"
port="${zero}" port="${zero}"
else else
port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
slots=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
ipsetinconfig=1 ipsetinconfig=1
@ -278,7 +278,7 @@ fn_info_config_wolfensteinenemyterritory(){
rconpassword=${rconpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"}
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"}
slots=${slots:-"0"} maxplayers=${maxplayers:-"0"}
port=${port:-"27960"} port=${port:-"27960"}
fi fi
} }
@ -288,18 +288,18 @@ fn_info_config_realvirtuality(){
servername="${unavailable}" servername="${unavailable}"
adminpassword="${unavailable}" adminpassword="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
slots="${zero}" maxplayers="${zero}"
else else
servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
slots=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
# Not Set # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
adminpassword=${adminpassword:-"NOT SET"} adminpassword=${adminpassword:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"}
slots=${slots:-"0"} maxplayers=${maxplayers:-"0"}
fi fi
} }
@ -308,20 +308,20 @@ fn_info_config_seriousengine35(){
servername="${unavailable}" servername="${unavailable}"
rconpassword="${unavailable}" rconpassword="${unavailable}"
gamemode="${unavailable}" gamemode="${unavailable}"
slots="${zero}" maxplayers="${zero}"
port="${zero}" port="${zero}"
else else
servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/prj_strMultiplayerSessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/prj_strMultiplayerSessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcts_strAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcts_strAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/gam_idGameMode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/gam_idGameMode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
slots=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') maxplayers=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
port=$(grep "prj_uwPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') port=$(grep "prj_uwPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
# Not Set # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
rconpassword=${rconpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"}
gamemode=${gamemode:-"NOT SET"} gamemode=${gamemode:-"NOT SET"}
slots=${slots:-"0"} maxplayers=${maxplayers:-"0"}
port=${port:-"0"} port=${port:-"0"}
fi fi
} }
@ -350,14 +350,14 @@ fn_info_config_starbound(){
port="21025" port="21025"
queryport="21025" queryport="21025"
rconport="21026" rconport="21026"
slots="8" maxplayers="8"
else else
servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
slots=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]')
# Not Set # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
@ -365,7 +365,7 @@ fn_info_config_starbound(){
port=${port:-"21025"} port=${port:-"21025"}
queryport=${queryport:-"21025"} queryport=${queryport:-"21025"}
rconport=${rconport:-"21026"} rconport=${rconport:-"21026"}
slots=${slots:-"8"} maxplayers=${maxplayers:-"8"}
fi fi
} }
@ -418,20 +418,20 @@ fn_info_config_teeworlds(){
serverpassword="${unavailable}" serverpassword="${unavailable}"
rconpassword="${unavailable}" rconpassword="${unavailable}"
port="8303" port="8303"
slots="12" maxplayers="12"
else else
servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
port=$(grep "sv_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port=$(grep "sv_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
slots=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
# Not Set # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"}
rconpassword=${rconpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"}
port=${port:-"8303"} port=${port:-"8303"}
slots=${slots:-"12"} maxplayers=${maxplayers:-"12"}
fi fi
} }
@ -440,18 +440,18 @@ fn_info_config_terraria(){
servername="${unavailable}" servername="${unavailable}"
port="${zero}" port="${zero}"
gameworld="${unavailable}" gameworld="${unavailable}"
slots="${zero}" maxplayers="${zero}"
else else
servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
port=$(grep "port" "${servercfgfullpath}" | tr -cd '[:digit:]') port=$(grep "port" "${servercfgfullpath}" | tr -cd '[:digit:]')
gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "//" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "//" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
slots=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
# Not Set # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
port=${port:-"0"} port=${port:-"0"}
gameworld=${gameworld:-"NOT SET"} gameworld=${gameworld:-"NOT SET"}
slots=${slots:-"0"} maxplayers=${maxplayers:-"0"}
fi fi
} }
@ -507,7 +507,7 @@ fn_info_config_sdtd(){
telnetenabled="${unavailable}" telnetenabled="${unavailable}"
telnetport="${zero}" telnetport="${zero}"
telnetpass="${unavailable}" telnetpass="${unavailable}"
slots="${unavailable}" maxplayers="${unavailable}"
gamemode="${unavailable}" gamemode="${unavailable}"
gameworld="${unavailable}" gameworld="${unavailable}"
else else
@ -523,7 +523,7 @@ fn_info_config_sdtd(){
telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
slots=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') maxplayers=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]')
gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
@ -538,7 +538,7 @@ fn_info_config_sdtd(){
telnetenabled=${telnetenabled:-"NOT SET"} telnetenabled=${telnetenabled:-"NOT SET"}
telnetport=${telnetport:-"0"} telnetport=${telnetport:-"0"}
telnetpass=${telnetpass:-"NOT SET"} telnetpass=${telnetpass:-"NOT SET"}
slots=${slots:-"NOT SET"} maxplayers=${maxplayers:-"NOT SET"}
gamemode=${gamemode:-"NOT SET"} gamemode=${gamemode:-"NOT SET"}
gameworld=${gameworld:-"NOT SET"} gameworld=${gameworld:-"NOT SET"}
fi fi

6
lgsm/functions/info_parms.sh

@ -49,20 +49,20 @@ fn_info_config_teeworlds(){
serverpassword="${unavailable}" serverpassword="${unavailable}"
rconpassword="${unavailable}" rconpassword="${unavailable}"
port="8303" port="8303"
slots="12" maxplayers="12"
else else
servername=$(grep "sv_name" "${servercfgfullpath}" | sed 's/sv_name //g' | sed 's/"//g') servername=$(grep "sv_name" "${servercfgfullpath}" | sed 's/sv_name //g' | sed 's/"//g')
serverpassword=$(grep "password " "${servercfgfullpath}" | awk '!/sv_rcon_password/'| sed 's/password //g' | tr -d '=\"; ') serverpassword=$(grep "password " "${servercfgfullpath}" | awk '!/sv_rcon_password/'| sed 's/password //g' | tr -d '=\"; ')
rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed 's/sv_rcon_password //g' | tr -d '=\"; ') rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed 's/sv_rcon_password //g' | tr -d '=\"; ')
port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]') port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]')
slots=$(grep "sv_max_clients" "${servercfgfullpath}" | tr -cd '[:digit:]') maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | tr -cd '[:digit:]')
# Not Set # Not Set
servername=${servername:-"NOT SET"} servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"}
rconpassword=${rconpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"}
port=${port:-"8303"} port=${port:-"8303"}
slots=${slots:-"12"} maxplayers=${maxplayers:-"12"}
fi fi
} }

Loading…
Cancel
Save