Search
| Bash script to search for working machines in a network |
|
|
|
| Programming - Bash |
| Tuesday, 29 June 2010 16:15 |
|
Below I give a small script that will help you to discover the machines that are plugged on to the network. It uses a small command called ping to discover the machines connected to the network. It will work only for the networks with subnet mask 255.255.255.0
Save this bash script to a file name checkip.sh. Then run the script from the terminal by typing
sh checkip.sh
Then it will prompt for the starting and ending ip addresses between which you want to discover the machines. The file validip will contain the list of pingable machines and file invalidip contains the list of ip addresses that arent used. Please remember to provide the smaller ip address as the first ip address or else you can try modifying the script so that it can accept the ip address in any order. Also the ping response should be enabled on all machines in the network. |
| Last Updated on Sunday, 04 July 2010 17:59 |




