diff --git a/functions/fn_details b/functions/fn_details index 3463272a2..afa6edd46 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -512,7 +512,7 @@ echo -e "" echo -e "\e[92mPorts\e[0m" printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = echo -e "Change ports by editing the command-line" -echo -e "parameters in ${selfname}." +echo -e "parameters in ${servercfgfullpath}." echo -e "" echo -e "Useful port diagnostic command:" echo -e "netstat -atunp | grep terraia" @@ -520,8 +520,6 @@ echo -e "" { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\ttcp" - echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" } >> .fn_details_ports column -s $'\t' -t .fn_details_ports rm -f .fn_details_ports diff --git a/functions/fn_details_config b/functions/fn_details_config index c85ea2316..233517d0f 100644 --- a/functions/fn_details_config +++ b/functions/fn_details_config @@ -382,6 +382,16 @@ elif [ "${gamename}" == "Teamspeak 3" ]; then fileport="30033" fi +elif [ "${engine}" == "terraria" ]; then + + # port + if [ -f "${servercfgfullpath}" ]; then + port=$(grep "port=" "${servercfgfullpath}" | tr -cd "[:digit:]") + fi + if [ ! -n "${port}" ]; then + port="0" + fi + elif [ "${engine}" == "unity3d" ]; then # server name