Skip to content

Instantly share code, notes, and snippets.

@danitfk
Last active July 11, 2019 09:50
Show Gist options
  • Save danitfk/fbdd462db3834e9aa0da7de68b3ccd57 to your computer and use it in GitHub Desktop.
Save danitfk/fbdd462db3834e9aa0da7de68b3ccd57 to your computer and use it in GitHub Desktop.
ips="10.233.64.0
10.233.65.0
10.233.70.0
10.233.71.0
10.233.66.0
10.233.69.0
10.233.67.0
10.233.68.0
10.233.73.0
10.233.72.0"
IP=$(ifconfig flannel.1 | grep inet | awk {'print $2'} | grep 10.)
echo "$HOSTNAME - $IP"
for ip in $ips
do
ping $ip -c1 -W1 > /dev/null
status=$(echo $?)
if [[ "$status" == "0" ]]; then
echo "$IP -> $ip - OK"
else
echo "$IP -> $ip - NOT OK"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment