gameservergame-servergame-servershacktoberfestdedicated-game-serversgamelinuxgsmserverbashgaminglinuxmultiplayer-game-servershell
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
218 lines
6.6 KiB
218 lines
6.6 KiB
#!/bin/bash
|
|
# LGSM fn_details function
|
|
# Author: Daniel Gibbs
|
|
# Website: http://danielgibbs.co.uk
|
|
# Version: 131114
|
|
|
|
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)
|
|
echo ""
|
|
echo "${gamename} Server Details"
|
|
echo "============================"
|
|
echo "Server name: ${servername}"
|
|
echo "Server IP: ${ip}:${port}"
|
|
echo "RCON password: ${rcon}"
|
|
echo "Config file: ${servercfgfullpath}"
|
|
echo ""
|
|
echo "Start Parameters"
|
|
echo "============================"
|
|
echo "${executable} ${parms}"
|
|
echo ""
|
|
echo "Server 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'||tr -d '\r')
|
|
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 "Server 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 "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
|
|
echo -e "Status:\e[0;31m OFFLINE\e[0;39m"
|
|
else
|
|
echo -e "Status:\e[0;32m ONLINE\e[0;39m"
|
|
fi
|
|
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 "Server 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}."
|
|
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_arma3details(){
|
|
fn_autoip
|
|
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}:${serverport}"
|
|
echo "Config file: ${servercfgfullpath}"
|
|
echo ""
|
|
echo "Admin Password: ${adminpass}"
|
|
echo ""
|
|
echo "Server Ports"
|
|
echo "============================"
|
|
echo "Ports the server is currently using."
|
|
echo ""
|
|
echo "PROTOCOL DESCRIPTION PORT"
|
|
echo "UDP Game port ${serverport}"
|
|
echo "UDP STEAM query port ${queryport}"
|
|
echo "UDP STEAM master traffic port ${masterport}"
|
|
echo ""
|
|
echo "You can change ports by editing the"
|
|
echo "parameters in ${servercfgfullpath}"
|
|
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 ""
|
|
}
|
|
|
|
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
|
|
elif [ "${engine}" == "realvirtuality" ]; then
|
|
fn_arma3details
|
|
else
|
|
echo "error: Unable to detect server engine!"
|
|
fi
|