|
267 | 267 | netint=$(${ipcommand} -o addr | grep "${ip}" | awk '{print $2}')
|
268 | 268 | netlink=$(${ethtoolcommand} "${netint}" 2>/dev/null| grep Speed | awk '{print $2}')
|
269 | 269 |
|
270 |
| -# External IP address |
271 |
| -if [ -z "${extip}" ]; then |
272 |
| - extip="$(curl --connect-timeout 10 -s https://api.ipify.org 2>/dev/null)" |
273 |
| - exitcode=$? |
274 |
| - # Should ifconfig.co return an error will use last known IP. |
275 |
| - if [ ${exitcode} -eq 0 ]; then |
276 |
| - if [[ "${extip}" != *"DOCTYPE"* ]]; then |
277 |
| - echo -e "${extip}" > "${tmpdir}/extip.txt" |
278 |
| - else |
279 |
| - if [ -f "${tmpdir}/extip.txt" ]; then |
280 |
| - extip="$(cat "${tmpdir}/extip.txt")" |
281 |
| - else |
282 |
| - fn_print_error_nl "Unable to get external IP" |
283 |
| - fi |
284 |
| - fi |
285 |
| - else |
286 |
| - if [ -f "${tmpdir}/extip.txt" ]; then |
287 |
| - extip="$(cat "${tmpdir}/extip.txt")" |
288 |
| - else |
289 |
| - fn_print_error_nl "Unable to get external IP" |
290 |
| - fi |
291 |
| - fi |
292 |
| -fi |
293 |
| - |
294 |
| -# Alert IP address |
295 |
| -if [ "${displayip}" ]; then |
296 |
| - alertip="${displayip}" |
297 |
| -elif [ "${extip}" ]; then |
298 |
| - alertip="${extip}" |
299 |
| -else |
300 |
| - alertip="${ip}" |
301 |
| -fi |
302 |
| - |
303 |
| -# Steam Master Server - checks if detected by master server. |
304 |
| -if [ -z "${displaymasterserver}" ]; then |
305 |
| - if [ "$(command -v jq 2>/dev/null)" ]; then |
306 |
| - if [ "${ip}" ]&&[ "${port}" ]; then |
307 |
| - if [ "${steammaster}" == "true" ]||[ "${commandname}" == "DEV-QUERY-RAW" ]; then |
308 |
| - # Will query server IP addresses first. |
309 |
| - for queryip in "${queryips[@]}"; do |
310 |
| - masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${queryip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" '.response.servers[] | select((.gameport == ($port|tonumber) or (.gameport == ($queryport|tonumber)))) | .addr' | wc -l 2>/dev/null)" |
311 |
| - done |
312 |
| - # Should that not work it will try the external IP. |
313 |
| - if [ "${masterserver}" == "0" ]; then |
314 |
| - masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${extip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" '.response.servers[] | select((.gameport == ($port|tonumber) or (.gameport == ($queryport|tonumber)))) | .addr' | wc -l 2>/dev/null)" |
315 |
| - fi |
316 |
| - if [ "${masterserver}" == "0" ]; then |
317 |
| - displaymasterserver="false" |
318 |
| - else |
319 |
| - displaymasterserver="true" |
320 |
| - fi |
321 |
| - fi |
322 |
| - fi |
323 |
| - fi |
324 |
| -fi |
325 | 270 | # Sets the SteamCMD glibc requirement if the game server requirement is less or not required.
|
326 | 271 | if [ "${appid}" ]; then
|
327 | 272 | if [ "${glibc}" = "null" ]||[ -z "${glibc}" ]||[ "$(printf '%s\n'${glibc}'\n' "2.14" | sort -V | head -n 1)" != "2.14" ]; then
|
|
0 commit comments