Commit 1d1d14ba authored by Edita Kizinevic's avatar Edita Kizinevic
Browse files

Add check for IPv6 address

parent 7c700ca8
......@@ -2,7 +2,7 @@
shopt -s expand_aliases
SCRIPT_REVISION="2020-02-17, Dave Dykstra and Edita Kizinevic"
SCRIPT_REVISION="2020-02-21, Dave Dykstra and Edita Kizinevic"
# Script does not use backupproxyurl if it is SAM test, but script uses backupproxyurl if it is pilot
......@@ -148,7 +148,7 @@ check_proxies() {
IP_addresses=`getent ahostsv4 $hostname | awk '/STREAM/{print $1}'`
if [ -z "$IP_addresses" ]; then
elif host $hostname | grep -q "has IPv6 address"; then
  • I suggest instead using getent ahostsv6 $hostname | awk '/STREAM/{print $1}' | grep -qv ^::ffff:. I think that's a little more robust because the host command only looks at the DNS but getent looks at all sources of IP addresses.

  • I replaced host with getent function 68b7d142

Please register or sign in to reply
IP_addresses="$IP_addresses $hostname"
for IP_address in $IP_addresses; do
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment