Skip to content

Instantly share code, notes, and snippets.

@bse666
Created January 20, 2017 12:51
Show Gist options
  • Save bse666/2935a123472b713ca9d9f1b4d488fb89 to your computer and use it in GitHub Desktop.
Save bse666/2935a123472b713ca9d9f1b4d488fb89 to your computer and use it in GitHub Desktop.
find free ip in dhcpd.conf
#!/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