Last active
August 29, 2015 14:14
-
-
Save benfairless/b1b47f41709e6a95fe14 to your computer and use it in GitHub Desktop.
Test for free IP addresses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Test of free IP addresses in 192.168.4.0/24 - Generated $(date +%d/%m/%Y\ %H:%M)" | |
for i in {1..254}; do | |
ADDR=192.168.4.$i | |
ping -c 1 $ADDR 2>&1 >/dev/null | |
if [ $? != 0 ]; then | |
echo "FREE - $ADDR" | |
else | |
echo "USED - $ADDR" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment