Browse Source

fix(sdtdserver): fixes to sdtd (#3041)

* fix sdtd config handling for the port

* add steamclient.so fix to sdtd

* removed logfile from parameters to allow console display

* steamclient.so bug fix

* allow accurate ip to be set for webadminip in most cases

* master server query will loop through server ip addresses

* more accurate details on telnet IP address

* minor tidy up of details web admin and telnet

* sdtd does not have an interactive console

* correct steamclient.so fix

* remove x86 binary as no longer present

* more changes to steamclient.so

Co-authored-by: H3o66 <[email protected]>
pull/3047/head
Daniel Gibbs 5 years ago
committed by GitHub
parent
commit
d961b05de3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      lgsm/config-default/config-lgsm/sdtdserver/_default.cfg
  2. 18
      lgsm/functions/check_ip.sh
  3. 2
      lgsm/functions/command_debug.sh
  4. 1
      lgsm/functions/fix_cmw.sh
  5. 1
      lgsm/functions/fix_cs.sh
  6. 40
      lgsm/functions/fix_hw.sh
  7. 10
      lgsm/functions/fix_pz.sh
  8. 2
      lgsm/functions/fix_rust.sh
  9. 2
      lgsm/functions/fix_sdtd.sh
  10. 5
      lgsm/functions/fix_ss3.sh
  11. 12
      lgsm/functions/fix_steamcmd.sh
  12. 5
      lgsm/functions/fix_tu.sh
  13. 5
      lgsm/functions/fix_wurm.sh
  14. 7
      lgsm/functions/info_config.sh
  15. 6
      lgsm/functions/info_distro.sh
  16. 74
      lgsm/functions/info_messages.sh

6
lgsm/config-default/config-lgsm/sdtdserver/_default.cfg

@ -13,7 +13,7 @@ ip="0.0.0.0"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
fn_parms(){ fn_parms(){
parms="-logfile ${gamelogdir}/output_log__$(date +%Y-%m-%d__%H-%M-%S).txt -quit -batchmode -nographics -dedicated -configfile=${servercfgfullpath}" parms="-quit -batchmode -nographics -dedicated -configfile=${servercfgfullpath}"
} }
#### LinuxGSM Settings #### #### LinuxGSM Settings ####
@ -138,7 +138,7 @@ querytype="protocol-valve"
## Console type ## Console type
consoleverbose="yes" consoleverbose="yes"
consoleinteract="yes" consoleinteract="no"
## Game Server Details ## Game Server Details
# Do not edit # Do not edit
@ -152,7 +152,7 @@ glibc="2.15"
## Game Server Directories ## Game Server Directories
systemdir="${serverfiles}" systemdir="${serverfiles}"
executabledir="${serverfiles}" executabledir="${serverfiles}"
executable=$([ "$(uname -m)" == "x86_64" ] && echo -e "./7DaysToDieServer.x86_64" || echo -e "./7DaysToDieServer.x86") executable="./7DaysToDieServer.x86_64"
servercfgdir="${systemdir}" servercfgdir="${systemdir}"
servercfg="${selfname}.xml" servercfg="${selfname}.xml"
servercfgdirdefault="${serverfiles}" servercfgdirdefault="${serverfiles}"

18
lgsm/functions/check_ip.sh

@ -23,13 +23,25 @@ getipwc=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\
# If the IP variable has been set by user. # If the IP variable has been set by user.
if [ -n "${ip}" ]&&[ "${ip}" != "0.0.0.0" ]; then if [ -n "${ip}" ]&&[ "${ip}" != "0.0.0.0" ]; then
queryips=( "${ip}" ) queryips=( "${ip}" )
# If game config does have an IP set. webadminip=( "${ip}" )
telnetip=( "${ip}" )
# If game config does have an IP set.
elif [ -n "${configip}" ]&&[ "${configip}" != "0.0.0.0" ];then elif [ -n "${configip}" ]&&[ "${configip}" != "0.0.0.0" ];then
queryips=( "${configip}" ) queryips=( "${configip}" )
ip="${configip}" ip="${configip}"
# If no ip is set by the user. webadminip=( "${configip}" )
telnetip=( "${configip}" )
# If there is only 1 server IP address.
# Some IP details can automaticly use the one IP
elif [ "${getipwc}" == "1" ]; then
queryips=( $(echo "${getip}") )
ip="0.0.0.0"
webadminip=( "${getip}" )
telnetip=( "${getip}" )
# If no ip is set by the user and server has more than one IP.
else else
queryips=( $(echo "${getip}") ) queryips=( $(echo "${getip}") )
ip="0.0.0.0" ip="0.0.0.0"
# If IP has not been set by user. webadminip=( "${ip}" )
telnetip=( "${ip}" )
fi fi

2
lgsm/functions/command_debug.sh

@ -55,7 +55,7 @@ if [ "${glibc}" ]; then
fi fi
# Server IP # Server IP
server echo -e "${lightblue}Game Server IP:\t${default}${ip}:${port}" echo -e "${lightblue}Game Server IP:\t${default}${ip}:${port}"
# External server IP. # External server IP.
if [ "${extip}" ]; then if [ "${extip}" ]; then

1
lgsm/functions/fix_cmw.sh

@ -15,6 +15,7 @@ fi
if [ ! -f "${executabledir}/lib/steamclient.so" ]; then if [ ! -f "${executabledir}/lib/steamclient.so" ]; then
fixname="steamclient.so x86" fixname="steamclient.so x86"
fn_fix_msg_start fn_fix_msg_start
mkdir -p "${executabledir}/lib"
if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${executabledir}/lib/steamclient.so" cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${executabledir}/lib/steamclient.so"
elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then

1
lgsm/functions/fix_cs.sh

@ -10,6 +10,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${serverfiles}/steamclient.so" ]; then if [ ! -f "${serverfiles}/steamclient.so" ]; then
fixname="steamclient.so x86" fixname="steamclient.so x86"
fn_fix_msg_start fn_fix_msg_start
mkdir -p "${serverfiles}"
if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/steamclient.so" cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/steamclient.so"
elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then

40
lgsm/functions/fix_hw.sh

@ -6,26 +6,26 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${shortname}" == "hw" ]; then # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then
if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then fixname="steamclient.so x86"
fixname="steamclient.so x86" fn_fix_msg_start
fn_fix_msg_start mkdir -p "${serverfiles}/Hurtworld_Data/Plugins/x86"
if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so"
elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then
cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so"
fi
fn_fix_msg_end
fi fi
if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then fn_fix_msg_end
fixname="steamclient.so x86_64" fi
fn_fix_msg_start if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then
if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then fixname="steamclient.so x86_64"
cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" fn_fix_msg_start
elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then mkdir -p "${serverfiles}/Hurtworld_Data/Plugins/x86_64"
cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then
fi cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so"
fn_fix_msg_end elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then
cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so"
fi fi
fn_fix_msg_end
fi fi

10
lgsm/functions/fix_pz.sh

@ -10,10 +10,11 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${serverfiles}/linux32/steamclient.so" ]; then if [ ! -f "${serverfiles}/linux32/steamclient.so" ]; then
fixname="steamclient.so x86" fixname="steamclient.so x86"
fn_fix_msg_start fn_fix_msg_start
mkdir -p "${serverfiles}/linux32"
if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/linux32/steamclient.so" >> "${lgsmlog}" cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/linux32/steamclient.so"
elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then
cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/linux32/steamclient.so" >> "${lgsmlog}" cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/linux32/steamclient.so"
fi fi
fn_fix_msg_end fn_fix_msg_end
fi fi
@ -21,10 +22,11 @@ fi
if [ ! -f "${serverfiles}/linux64/steamclient.so" ]; then if [ ! -f "${serverfiles}/linux64/steamclient.so" ]; then
fixname="steamclient.so x86_64" fixname="steamclient.so x86_64"
fn_fix_msg_start fn_fix_msg_start
mkdir -p "${serverfiles}/linux64"
if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then
cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${serverfiles}/linux64/steamclient.so" >> "${lgsmlog}" cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${serverfiles}/linux64/steamclient.so"
elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then
cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/linux64/steamclient.so" >> "${lgsmlog}" cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/linux64/steamclient.so"
fi fi
fn_fix_msg_end fn_fix_msg_end
fi fi

2
lgsm/functions/fix_rust.sh

@ -7,4 +7,4 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: [Raknet] Server Shutting Down (Shutting Down). # Fixes: [Raknet] Server Shutting Down (Shutting Down).
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${systemdir}/RustDedicated_Data/Plugins/x86_64" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64"

2
lgsm/functions/fix_sdtd.sh

@ -6,4 +6,4 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}/7DaysToDieServer_Data/Plugins/x86_64"

5
lgsm/functions/fix_ss3.sh

@ -10,6 +10,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${serverfiles}/Bin/steamclient.so" ]||[ "$(diff "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" 2>/dev/null)" ]; then if [ ! -f "${serverfiles}/Bin/steamclient.so" ]||[ "$(diff "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" 2>/dev/null)" ]; then
fixname="steamclient.so" fixname="steamclient.so"
fn_fix_msg_start fn_fix_msg_start
mkdir -p "${serverfiles}/Bin"
cp -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" cp -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so"
fn_fix_msg_end fn_fix_msg_end
fi fi
@ -18,7 +19,7 @@ fi
if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then
fixname="libsteam.so" fixname="libsteam.so"
fn_fix_msg_start fn_fix_msg_start
mkdir -pv "${HOME}/.steam/bin32" >> "${lgsmlog}" mkdir -p "${HOME}/.steam/bin32"
cp "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" >> "${lgsmlog}" cp "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so"
fn_fix_msg_end fn_fix_msg_end
fi fi

12
lgsm/functions/fix_steamcmd.sh

@ -10,11 +10,11 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then
fixname="steamclient.so sdk64" fixname="steamclient.so sdk64"
fn_fix_msg_start fn_fix_msg_start
mkdir -pv "${HOME}/.steam/sdk64" >> "${lgsmlog}" mkdir -p "${HOME}/.steam/sdk64"
if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then
cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" >> "${lgsmlog}" cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so"
elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then
cp "${steamcmddir}/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" >> "${lgsmlog}" cp "${steamcmddir}/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so"
fi fi
fn_fix_msg_end fn_fix_msg_end
fi fi
@ -23,11 +23,11 @@ fi
if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then
fixname="steamclient.so sdk32" fixname="steamclient.so sdk32"
fn_fix_msg_start fn_fix_msg_start
mkdir -pv "${HOME}/.steam/sdk32" >> "${lgsmlog}" mkdir -p "${HOME}/.steam/sdk32"
if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${lgsmlog}" cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then
cp "${steamcmddir}/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${lgsmlog}" cp "${steamcmddir}/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so"
fi fi
fn_fix_msg_end fn_fix_msg_end
fi fi

5
lgsm/functions/fix_tu.sh

@ -10,10 +10,11 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${executabledir}/steamclient.so" ]; then if [ ! -f "${executabledir}/steamclient.so" ]; then
fixname="steamclient.so x86_64" fixname="steamclient.so x86_64"
fn_fix_msg_start fn_fix_msg_start
mkdir -p "${executabledir}"
if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then
cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${executabledir}/steamclient.so"
elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then
cp "${steamcmddir}/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" cp "${steamcmddir}/linux64/steamclient.so" "${executabledir}/steamclient.so"
fi fi
fn_fix_msg_end fn_fix_msg_end
fi fi

5
lgsm/functions/fix_wurm.sh

@ -9,10 +9,11 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${serverfiles}/nativelibs" ]; then if [ ! -f "${serverfiles}/nativelibs" ]; then
fixname="steamclient.so x86" fixname="steamclient.so x86"
fn_fix_msg_start fn_fix_msg_start
mkdir -p "${serverfiles}/nativelibs"
if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/nativelibs" >> "${lgsmlog}" cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/nativelibs/steamclient.so"
elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then
cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/nativelibs" >> "${lgsmlog}" cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/nativelibs/steamclient.so"
fi fi
fn_fix_msg_end fn_fix_msg_end
fi fi

7
lgsm/functions/info_config.sh

@ -1241,6 +1241,7 @@ fn_info_config_sdtd(){
telnetenabled="${unavailable}" telnetenabled="${unavailable}"
telnetport="${zero}" telnetport="${zero}"
telnetpass="${unavailable}" telnetpass="${unavailable}"
telnetip="${unavailable}"
maxplayers="${unavailable}" maxplayers="${unavailable}"
gamemode="${unavailable}" gamemode="${unavailable}"
gameworld="${unavailable}" gameworld="${unavailable}"
@ -1256,7 +1257,11 @@ fn_info_config_sdtd(){
telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
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"\"")
# Telnet IP will be localhost if no password is set
# check_ip will set the IP first. This will overwrite it.
if [ -z "${telnetpass}" ]; then
telnetip="127.0.0.1"
fi
maxplayers=$(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"\"")

6
lgsm/functions/info_distro.sh

@ -262,7 +262,11 @@ fi
if [ "$(command -v jq 2>/dev/null)" ]; then if [ "$(command -v jq 2>/dev/null)" ]; then
if [ "${ip}" ]&&[ "${port}" ]; then if [ "${ip}" ]&&[ "${port}" ]; then
if [ "${steammaster}" == "true" ]; then if [ "${steammaster}" == "true" ]; then
masterserver=$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null) # Will query server IP addresses first.
for queryip in "${queryips[@]}"; do
masterserver=$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${queryip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)
done
# Should that not work it will try the external IP.
if [ "${masterserver}" == "0" ]; then if [ "${masterserver}" == "0" ]; then
masterserver=$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null) masterserver=$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)
fi fi

74
lgsm/functions/info_messages.sh

@ -783,7 +783,7 @@ fn_info_message_eco(){
{ {
echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
echo -e "> Game\tINBOUND\t${port}\tudp" echo -e "> Game\tINBOUND\t${port}\tudp"
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
} | column -s $'\t' -t } | column -s $'\t' -t
} }
@ -1107,23 +1107,23 @@ fn_info_message_sdtd(){
echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
echo -e "> Game/RCON\tINBOUND\t${port}\tudp" echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
echo -e "> Query\tINBOUND\t${queryport}\tudp" echo -e "> Query\tINBOUND\t${queryport}\tudp"
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp" echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} WebAdmin${default}" echo -e "${lightgreen}${gamename} Web Admin${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}" echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}" echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} Telnet${default}" echo -e "${lightgreen}${gamename} Telnet${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}" echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}"
echo -e "${lightblue}Telnet address:\t${default}${ip} ${telnetport}" echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}"
echo -e "${lightblue}Telnet password:\t${default}${telnetpass}" echo -e "${lightblue}Telnet password:\t${default}${telnetpass}"
} | column -s $'\t' -t } | column -s $'\t' -t
} }
@ -1156,15 +1156,15 @@ fn_info_message_spark(){
echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
echo -e "> Game/RCON\tINBOUND\t${port}\tudp" echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
echo -e "> Query\tINBOUND\t${queryport}\tudp" echo -e "> Query\tINBOUND\t${queryport}\tudp"
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} WebAdmin${default}" echo -e "${lightgreen}${servername} Web Admin${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html" echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html"
echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}" echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
} | column -s $'\t' -t } | column -s $'\t' -t
} }
@ -1269,16 +1269,16 @@ fn_info_message_unreal(){
echo -e "< Steam\tINBOUND\t20660\tudp" echo -e "< Steam\tINBOUND\t20660\tudp"
fi fi
fi fi
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} WebAdmin${default}" echo -e "${lightgreen}${servername} Web Admin${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}" echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}" echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}" echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
} | column -s $'\t' -t } | column -s $'\t' -t
} }
@ -1293,16 +1293,16 @@ fn_info_message_unreal2(){
if [ "${appid}" != "223250" ]; then if [ "${appid}" != "223250" ]; then
echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}" echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
fi fi
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} WebAdmin${default}" echo -e "${lightgreen}${servername} Web Admin${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}" echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}" echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}" echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
} | column -s $'\t' -t } | column -s $'\t' -t
} }
@ -1314,16 +1314,16 @@ fn_info_message_unreal3(){
echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
echo -e "> Game\tINBOUND\t${port}\tudp" echo -e "> Game\tINBOUND\t${port}\tudp"
echo -e "> Query\tINBOUND\t${queryport}\tudp" echo -e "> Query\tINBOUND\t${queryport}\tudp"
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} WebAdmin${default}" echo -e "${lightgreen}${servername} Web Admin${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}" echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}" echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}" echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
} | column -s $'\t' -t } | column -s $'\t' -t
} }
@ -1355,16 +1355,16 @@ fn_info_message_kf2(){
echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}" echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}"
echo -e "> Query\tINBOUND\t${queryport}\tudp" echo -e "> Query\tINBOUND\t${queryport}\tudp"
echo -e "> Steam\tINBOUND\t20560\tudp" echo -e "> Steam\tINBOUND\t20560\tudp"
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} WebAdmin${default}" echo -e "${lightgreen}${servername} Web Admin${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}" echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}" echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}" echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
} | column -s $'\t' -t } | column -s $'\t' -t
} }

Loading…
Cancel
Save