Skip to content

Instantly share code, notes, and snippets.

@arifsuhan
Last active May 31, 2019 06:00
Show Gist options
  • Save arifsuhan/27d2decb0ad1c801f2bff8e5e58c9a90 to your computer and use it in GitHub Desktop.
Save arifsuhan/27d2decb0ad1c801f2bff8e5e58c9a90 to your computer and use it in GitHub Desktop.
bdix site connection check
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