Commit 68b7d142 authored by Edita Kizinevic's avatar Edita Kizinevic
Browse files

Merge branch 'master' into 'master'

Replace host with getent function

See merge request !22
parents a5ef8579 b720b116
......@@ -2,7 +2,7 @@
shopt -s expand_aliases
SCRIPT_REVISION="2020-02-21, Dave Dykstra and Edita Kizinevic"
SCRIPT_REVISION="2020-02-24, Dave Dykstra and Edita Kizinevic"
# Script does not use backupproxyurl if it is SAM test, but script uses backupproxyurl if it is pilot
includebackups=false
......@@ -148,7 +148,7 @@ check_proxies() {
IP_addresses=`getent ahostsv4 $hostname | awk '/STREAM/{print $1}'`
if [ -z "$IP_addresses" ]; then
IP_addresses=$hostname
elif host $hostname | grep -q "has IPv6 address"; then
elif getent ahostsv6 $hostname | awk '/STREAM/{print $1}' | grep -qv ^::ffff:; then
IP_addresses="$IP_addresses $hostname"
fi
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