|
|
@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" |
|
|
|
|
|
|
|
info_game.sh |
|
|
|
|
|
|
|
ip_commands_array=("/bin/ip" "/usr/sbin/ip" "ip") |
|
|
|
ip_commands_array=("ip" "/bin/ip" "/usr/sbin/ip") |
|
|
|
for ip_command in "${ip_commands_array[@]}"; do |
|
|
|
if [ "$(command -v "${ip_command}" 2> /dev/null)" ]; then |
|
|
|
ipcommand="${ip_command}" |
|
|
@ -18,7 +18,7 @@ for ip_command in "${ip_commands_array[@]}"; do |
|
|
|
fi |
|
|
|
done |
|
|
|
|
|
|
|
ethtool_commands_array=("/bin/ethtool" "/usr/sbin/ethtool" "ethtool") |
|
|
|
ethtool_commands_array=("ethtool" "/bin/ethtool" "/usr/sbin/ethtool") |
|
|
|
for ethtool_command in "${ethtool_commands_array[@]}"; do |
|
|
|
if [ "$(command -v "${ethtool_command}" 2> /dev/null)" ]; then |
|
|
|
ethtoolcommand="${ethtool_command}" |
|
|
@ -34,21 +34,21 @@ function fn_is_valid_ip() { |
|
|
|
grep -qEe '^[1-9]+[0-9]*\.[0-9]+\.[0-9]+\.[0-9]+$' <<< "${ip}" |
|
|
|
} |
|
|
|
|
|
|
|
# Check if server has multiple IP addresses |
|
|
|
# Check if server has multiple IP addresses. |
|
|
|
|
|
|
|
# If the IP variable has been set by user. |
|
|
|
if fn_is_valid_ip "${ip}"; then |
|
|
|
queryips=("${ip}") |
|
|
|
httpip=("${ip}") |
|
|
|
telnetip=("${ip}") |
|
|
|
# If game config does have an IP set. |
|
|
|
# If the game config has an IP set. |
|
|
|
elif fn_is_valid_ip "${configip}"; then |
|
|
|
queryips=("${configip}") |
|
|
|
ip="${configip}" |
|
|
|
httpip=("${configip}") |
|
|
|
telnetip=("${configip}") |
|
|
|
# If there is only 1 server IP address. |
|
|
|
# Some IP details can automaticly use the one IP |
|
|
|
# Some IP details can automatically use the one IP. |
|
|
|
elif [ "${#current_ips[@]}" == "1" ]; then |
|
|
|
queryips=("127.0.0.1" "${current_ips[@]}") |
|
|
|
ip="0.0.0.0" |
|
|
|