#!/bin/bash
local_ip="$(hostname -i | grep -oE '[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}')"
domains="$(cat /opt/cloudfave/cluster_config.js | grep domain | awk '/domain: / { print $2 }' | sed -e \"s/[,']//g\")"
for host in $domains
do
ip="$(nslookup $host | awk '/^Address: / { print $2 }')"
if [ $ip != $local_ip ]; then
echo $ip
sleep 1
fi
done