Hi How to check the range of IPs with script
#!/bin/bash
#Author:- Deepak G Ghule
#Date :- 25/10/2009
#Subject :- Let us ping range of IPs to know the status of machine (UP/DOWN)
for i 192.168.1.{1..255}; //checks 192.168.1.x class of IPs
do
ping -c2 $i > /dev/null;
[ $? -eq 0 ] && echo $i is up
trap "exit" SIGINT //To force exit when Ctrl+c keystroke is applied
done
now save it as net.sh
now give the execute persmission with following command
[crackmind@crakmind.com~]#chmod +x /netsh.sh
thanks for visit my blogs
Blog Archive
-
▼
2009
(8)
-
▼
October
(8)
- Sending mails using the command line
- Let us ping range of IPs machine
- Useradd via shell script IN Linux
- To check desire machine status for up or down by I...
- To know Disk space Alert by mail in Linux
- Access Windows shares from the terminal
- Aircel/Airtel GPRS on linux via USB cable/bluetoot...
- To check Linux service is on or off
-
▼
October
(8)