Created
January 7, 2020 14:07
-
-
Save prameshbajra/fdefa5588c158df170880165a01f2f3e to your computer and use it in GitHub Desktop.
Gives the list of IPs that are Busy or Open.
This file contains 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/sh | |
# Uncomment for debugging | |
#set -x | |
pingf(){ | |
if ping -w 2 -q -c 1 192.168.1."$1" > /dev/null ; | |
then | |
printf "IP %s is up\n" 192.168.1."$1" | |
else | |
printf "IP %s is open\n" 192.168.1."$1" | |
fi | |
} | |
main(){ | |
NUM=1 | |
while [ $NUM -lt 255 ];do | |
pingf "$NUM" & | |
NUM=$(expr "$NUM" + 1) | |
done | |
wait | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment