Browse Source

added SS3 details

* Added SS3 details
* functions now alphabetical
pull/254/merge
Daniel Gibbs 10 years ago
parent
commit
d6e626c9f8
  1. 231
      functions/fn_details

231
functions/fn_details

@ -2,101 +2,68 @@
# LGSM fn_details function # LGSM fn_details function
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk # Website: http://danielgibbs.co.uk
# Version: 101214 # Version: 161214
fn_sourcedetails(){ fn_avalanchedetails(){
fn_autoip fn_autoip
fn_parms
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
echo "============================" echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "Start Parameters"
echo "============================"
echo "${executable} ${parms}"
echo ""
echo "Server Ports" echo "Server Ports"
echo "============================" echo "============================"
echo "Ports the server is currently using." echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game port ${port}"
if [ ! -z "${sourcetvport}" ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi
echo "OUTBOUND Client port ${clientport}"
echo "" echo ""
echo "You can change ports by editing the" echo "You can change ports by editing the"
echo "start parameters in ${selfname}." echo "start parameters in ${selfname}."
echo "" echo ""
if [ "${pid}" == "0" ]; then if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else else
echo -e "Status:\e[0;32m ONLINE\e[0;39m" echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi fi
echo "" echo ""
} }
fn_unrealdetails(){ fn_realvirtualitydetails(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfgfullpath}"|grep -v //|sed -e 's/\<hostname\>//g'|tr -d '=\"; ')
serverport=$(grep -s serverport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
queryport=$(grep -s steamqueryport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
masterport=$(grep -s steamport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|tr -d '\r'|tr -cd [:digit:])
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|tr -d '\r'|tr -cd [:digit:])
udplinkport=$((${gameport} + 2))
webadminport=$(grep ListenPort= "${systemdir}/${ini}"|tr -d '\r'|tr -cd [:digit:])
if [ "${engine}" == "unreal" ]; then
webadminuser=$(grep AdminUsername= "${systemdir}/${ini}"|sed 's/\AdminUsername=//g')
else
webadminuser=$(grep AdminName= "${systemdir}/${ini}"|sed 's/\AdminName=//g')
fi
webadminpass=$(grep AdminPassword= "${systemdir}/${ini}"|sed 's/\AdminPassword=//g')
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
echo "============================" echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${gameport}" echo "Server IP: ${ip}:${serverport}"
echo "Config file: ${systemdir}/${ini}" echo "Config file: ${servercfgfullpath}"
echo ""
echo "Admin Password: ${adminpass}"
echo "" echo ""
echo "Server Ports" echo "Server Ports"
echo "============================" echo "============================"
echo "Ports the server is currently using." echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT INI VARIABLE" if [ -z ${serverport} ] || [ -z ${queryport} ] || [ -z ${masterport} ] ; then
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}" echo -e "\e[0;31mERROR!\e[0;39m Missing/commented ports in ${servercfg}."
echo "INBOUND Query Port ${queryport} UDP n/a" echo ""
if [ "${engine}" == "unreal" ]; then
echo "OUTBOUND UdpLink Port (random) ${udplinkport}+ UDP n/a"
fi
if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
echo "INBOUND GameSpy Query Port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
fi
if [ "${appid}" == "215360" ]; then
echo "OUTBOUND Master Server port 28852 TCP/UDP n/a"
else
echo "OUTBOUND Master Server port 28900/28902 TCP/UDP n/a"
fi
if [ "${appid}" ]; then
if [ "${appid}" == "223250" ]; then
echo "OUTBOUND Steam Port 20610 UDP n/a"
else
echo "OUTBOUND Steam Port 20660 UDP n/a"
fi
fi fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}" echo "PROTOCOL DESCRIPTION PORT"
echo "UDP Game port ${serverport}"
echo "UDP STEAM query port ${queryport}"
echo "UDP STEAM master traffic port ${masterport}"
echo "" echo ""
echo "${servername} WebAdmin" echo "You can change ports by editing the"
echo "=======================" echo "parameters in ${servercfgfullpath}"
echo "WebAdmin URL: http://${ip}:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo "" echo ""
if [ "${pid}" == "0" ]; then if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
@ -106,15 +73,21 @@ fi
echo "" echo ""
} }
fn_ns2details(){ fn_seriousengine35details(){
fn_autoip fn_autoip
queryport=$((${port} + 1)) fn_parms
servername=$(grep -s prj_strMultiplayerSessionName "${servercfgfullpath}"|sed 's/prj_strMultiplayerSessionName = //g'|sed 's/"//g'|sed 's/;//g')
rcon=$(grep -s rcts_strAdminPassword "${servercfgfullpath}"|sed 's/rcts_strAdminPassword = //g'|sed 's/"//g'|sed 's/;//g')
gameport=$(grep -s prj_uwPort "${servercfgfullpath}"|tr -d '\r'|tr -cd [:digit:])
queryport=$((${gameport} + 1))
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
echo "============================" echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "Server Ports" echo "Server Ports"
echo "============================" echo "============================"
@ -122,17 +95,10 @@ echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}" echo "INBOUND Game/RCON port ${port}"
echo "INBOUND Query Port ${queryport}" echo "INBOUND Query port ${queryport}"
echo "INBOUND WebAdmin ${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://${ip}:${webadminport}/index.html"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo "" echo ""
echo "You can change various parameters by editing the" echo "You can change ports by editing the"
echo "start parameters in ${selfname}." echo "parameters in ${servercfgfullpath}"
echo "" echo ""
if [ "${pid}" == "0" ]; then if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
@ -142,27 +108,74 @@ fi
echo "" echo ""
} }
fn_jc2details(){ fn_sourcedetails(){
fn_autoip fn_autoip
fn_parms
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
echo "============================" echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}" echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}" echo "Config file: ${servercfgfullpath}"
echo "" echo ""
echo "Start Parameters"
echo "============================"
echo "${executable} ${parms}"
echo ""
echo "Server Ports" echo "Server Ports"
echo "============================" echo "============================"
echo "Ports the server is currently using." echo "Ports the server is currently using."
echo "" echo ""
echo "DIRECTION DESCRIPTION PORT" echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game port ${port}" echo "INBOUND Game/RCON port ${port}"
if [ ! -z "${sourcetvport}" ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi
echo "OUTBOUND Client port ${clientport}"
echo "" echo ""
echo "You can change ports by editing the" echo "You can change ports by editing the"
echo "start parameters in ${selfname}." echo "start parameters in ${selfname}."
echo "" echo ""
if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi
echo ""
}
fn_sparkdetails(){
fn_autoip
queryport=$((${port} + 1))
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
echo ""
echo "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${port}"
echo ""
echo "Server Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
echo "INBOUND Query port ${queryport}"
echo "INBOUND WebAdmin ${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://${ip}:${webadminport}/index.html"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo ""
echo "You can change various parameters by editing the"
echo "start parameters in ${selfname}."
echo ""
if [ "${pid}" == "0" ]; then if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else else
@ -171,37 +184,59 @@ fi
echo "" echo ""
} }
fn_arma3details(){ fn_unrealdetails(){
fn_autoip fn_autoip
servername=$(grep -s hostname "${servercfgfullpath}"|grep -v //|sed -e 's/\<hostname\>//g'|tr -d '=\"; ')
serverport=$(grep -s serverport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
queryport=$(grep -s steamqueryport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
masterport=$(grep -s steamport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l) pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|tr -d '\r'|tr -cd [:digit:])
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|tr -d '\r'|tr -cd [:digit:])
udplinkport=$((${gameport} + 2))
webadminport=$(grep ListenPort= "${systemdir}/${ini}"|tr -d '\r'|tr -cd [:digit:])
if [ "${engine}" == "unreal" ]; then
webadminuser=$(grep AdminUsername= "${systemdir}/${ini}"|sed 's/\AdminUsername=//g')
else
webadminuser=$(grep AdminName= "${systemdir}/${ini}"|sed 's/\AdminName=//g')
fi
webadminpass=$(grep AdminPassword= "${systemdir}/${ini}"|sed 's/\AdminPassword=//g')
echo "" echo ""
echo "${gamename} Server Details" echo "${gamename} Server Details"
echo "============================" echo "============================"
echo "Server name: ${servername}" echo "Server name: ${servername}"
echo "Server IP: ${ip}:${serverport}" echo "Server IP: ${ip}:${gameport}"
echo "Config file: ${servercfgfullpath}" echo "Config file: ${systemdir}/${ini}"
echo ""
echo "Admin Password: ${adminpass}"
echo "" echo ""
echo "Server Ports" echo "Server Ports"
echo "============================" echo "============================"
echo "Ports the server is currently using." echo "Ports the server is currently using."
echo "" echo ""
if [ -z ${serverport} ] || [ -z ${queryport} ] || [ -z ${masterport} ] ; then echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo -e "\e[0;31mERROR!\e[0;39m Missing/commented ports in ${servercfg}." echo "INBOUND Game port ${gameport} UDP Port=${gameport}"
echo "" echo "INBOUND Query port ${queryport} UDP n/a"
if [ "${engine}" == "unreal" ]; then
echo "OUTBOUND UdpLink Port (random) ${udplinkport}+ UDP n/a"
fi fi
echo "PROTOCOL DESCRIPTION PORT" if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
echo "UDP Game port ${serverport}" echo "INBOUND GameSpy query port ${gsqueryport} UDP OldQueryPortNumber=${gsqueryport}"
echo "UDP STEAM query port ${queryport}" fi
echo "UDP STEAM master traffic port ${masterport}" if [ "${appid}" == "215360" ]; then
echo "OUTBOUND Master server port 28852 TCP/UDP n/a"
else
echo "OUTBOUND Master server port 28900/28902 TCP/UDP n/a"
fi
if [ "${appid}" ]; then
if [ "${appid}" == "223250" ]; then
echo "OUTBOUND Steam port 20610 UDP n/a"
else
echo "OUTBOUND Steam port 20660 UDP n/a"
fi
fi
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo "" echo ""
echo "You can change ports by editing the" echo "${servername} WebAdmin"
echo "parameters in ${servercfgfullpath}" echo "======================="
echo "WebAdmin URL: http://${ip}:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
echo "" echo ""
if [ "${pid}" == "0" ]; then if [ "${pid}" == "0" ]; then
echo -e "Status:\e[0;31m OFFLINE\e[0;39m" echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
@ -211,16 +246,18 @@ fi
echo "" echo ""
} }
if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then if [ "${engine}" == "avalanche" ]; then
fn_avalanchedetails
elif [ "${engine}" == "realvirtuality" ]; then
fn_realvirtualitydetails
elif [ "${engine}" == "seriousengine35" ]; then
fn_seriousengine35details
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
fn_sourcedetails fn_sourcedetails
elif [ "${engine}" == "spark" ]; then
fn_sparkdetails
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
fn_unrealdetails fn_unrealdetails
elif [ "${engine}" == "spark" ]; then
fn_ns2details
elif [ "${engine}" == "avalanche" ]; then
fn_jc2details
elif [ "${engine}" == "realvirtuality" ]; then
fn_arma3details
else else
echo "error: Unable to detect server engine!" echo "error: Unable to detect server engine!"
fi fi
Loading…
Cancel
Save