Created
January 20, 2017 12:51
-
-
Save bse666/2935a123472b713ca9d9f1b4d488fb89 to your computer and use it in GitHub Desktop.
find free ip in dhcpd.conf
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 | |
for ip in 192.168.77.{254..1} ; do | |
grep -oE "$ip" dhcpd.conf > /dev/null 2>&1 | |
if [ $? != 0 ] ; then | |
echo "$ip is free" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment