Commit c000b8b2 authored by Edita Kizinevic's avatar Edita Kizinevic Committed by Andrea Sciaba
Browse files

Use getent command instead of host

parent 0d5e1d51
......@@ -99,29 +99,12 @@ check_proxies() {
*"(proxyurl="*)
hostname=${proxy#*//}
hostname=${hostname%:*}
IP_addresses=`host $hostname | grep "has.*address" | awk '{ print $NF }'`
# The frontier client does not work with IPv6 addresses in URLs for now
IP_addresses=`getent ahostsv4 $hostname | awk '/STREAM/{print $1}'`
if [ -z "$IP_addresses" ]; then
echo "Host $hostname not found"
echo
ever_failed=true
continue
IP_addresses=$hostname
fi
IPv4_addresses=()
IPv6_addresses=()
for IP_address in $IP_addresses; do
if [[ $IP_address =~ .*:.* ]]; then
IPv6_addresses+=( "[$IP_address]" )
else
IPv4_addresses+=( $IP_address )
fi
done
if [ ${#IPv4_addresses[@]} -eq 0 ]; then
# The frontier client does not work with IPv6 addresses in URLs for now
IP_addresses=( $hostname ) # ( "${IPv6_addresses[@]}" )
else
IP_addresses=( "${IPv4_addresses[@]}" )
fi
for IP_address in "${IP_addresses[@]}"; do
proxy_IP=`echo $proxy | sed "s/$hostname/$IP_address/g"`
echo "Query $proxy started:" `date`
echo 'select 1 from dual' | FRONTIER_SERVER="$proxy_IP(serverurl=http://cmsfrontier.cern.ch:8000/FrontierProd)(failovertoserver=no)" fn-req > $output
......
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