Skip to content

Instantly share code, notes, and snippets.

@vmanyushin

vmanyushin/findip.sh

Last active Mar 6, 2018
Embed
What would you like to do?
# find next free ip address
# fping required
#
export SUBNET=25; echo $(for i in $(seq 10 253); do ip="172.16.${SUBNET}.${i}"; fping -c 1 -t 500 $ip &> /dev/null; if [ $? -eq 1 ]; then echo $ip; break; fi; done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment