Skip to content

Instantly share code, notes, and snippets.

@fapestniegd
Created June 23, 2010 17:23
Show Gist options
  • Save fapestniegd/450233 to your computer and use it in GitHub Desktop.
Save fapestniegd/450233 to your computer and use it in GitHub Desktop.
for n in `seq 2 253`;do NAME=''; ping -w3 -c3 192.168.7.${n} >/dev/null 2>&1; PINGS=$?; NAME=$(dig +short -x 192.168.7.${n}); if [ "${NAME}" == "" ]; then if [ ${PINGS} -ne 0 ];then echo 192.168.7.${n} is available;fi;fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment