Last active
May 31, 2019 06:00
-
-
Save arifsuhan/27d2decb0ad1c801f2bff8e5e58c9a90 to your computer and use it in GitHub Desktop.
bdix site connection check
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
function check_ping () { | |
ping -q -c1 $1 > /dev/null | |
if [ $? -eq 0 ] | |
then | |
echo "(!)" $1 "is connected" | |
else | |
echo "(x)" $1 "is not connected" | |
fi | |
} | |
function series_ip(){ | |
for ip in `seq 1 $1` | |
do | |
check_ping 192.168.0.$ip | |
done | |
} | |
function main(){ | |
echo "\n" | |
series_ip $1 | |
echo "\n" | |
} | |
function rangeCheck() | |
{ | |
echo "Enter IP Range:" | |
read range_v | |
main $range_v | |
} | |
rangeCheck |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment