Browse Source

Added all variations of fn_details

All variations of fn_details are now in the file. The function decides
which one it requires.
pull/254/merge
Daniel Gibbs 11 years ago
parent
commit
90f721dc7d
  1. 152
      functions/fn_details

152
functions/fn_details

@ -4,7 +4,9 @@
# Website: http://danielgibbs.co.uk
# Version: 121114
fn_sourcedetails(){
fn_autoip
fn_parms
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)
@ -16,16 +18,147 @@ echo "Server IP: ${ip}:${port}"
echo "RCON password: ${rcon}"
echo "Config file: ${servercfgfullpath}"
echo ""
echo "Start Parameters"
echo "============================"
echo "${executable} ${parms}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
fi
echo "OUTBOUND Client port ${clientport}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}."
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_unrealdetails(){
fn_autoip
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|sed 's/\Port=//g')
queryport=$((${gameport} + 1))
gsqueryport=$(grep OldQueryPortNumber= "${systemdir}/${ini}"|sed 's/\OldQueryPortNumber=//g')
udplinkport=$((${gameport} + 2))
webadminport=$(grep ListenPort= "${systemdir}/${ini}"|sed 's/\ListenPort=//g')
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 "${gamename} Server Details"
echo "============================"
echo "Server name: ${servername}"
echo "Server IP: ${ip}:${gameport}"
echo "Config file: ${systemdir}/${ini}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT INI VARIABLE"
echo "INBOUND Game Port ${gameport} UDP Port=${gameport}"
echo "INBOUND Query Port ${queryport} UDP n/a"
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
echo "INBOUND WebAdmin ${webadminport} TCP ListenPort=${webadminport}"
echo ""
echo "${servername} WebAdmin"
echo "======================="
echo "WebAdmin URL: http://${ip}:${webadminport}"
echo "WebAdmin Username: ${webadminuser}"
echo "WebAdmin Password: ${webadminpass}"
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_ns2details(){
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 "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game/RCON port ${port}"
if [ ! -z ${sourcetvport} ]; then
echo "INBOUND SourceTV port ${sourcetvport}"
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
echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi
echo "OUTBOUND Client port ${clientport}"
echo ""
}
fn_jc2details(){
fn_autoip
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
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 "Config file: ${servercfgfullpath}"
echo ""
echo "${servername} Ports"
echo "============================"
echo "Ports the server is currently using."
echo ""
echo "DIRECTION DESCRIPTION PORT"
echo "INBOUND Game port ${port}"
echo ""
echo "You can change ports by editing the"
echo "start parameters in ${selfname}."
@ -35,4 +168,15 @@ if [ "${pid}" == "0" ]; then
else
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
fi
echo ""
echo ""
}
if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
fn_sourcedetails
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
fn_unrealdetails
elif [ "${engine}" == "spark" ]; then
fn_ns2details
elif [ "${engine}" == "avalanche" ]; then
fn_jc2details
fi
Loading…
Cancel
Save