LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shell Scripting question involving ping (https://www.linuxquestions.org/questions/linux-newbie-8/shell-scripting-question-involving-ping-659013/)

jhilton 07-29-2008 09:30 AM

Shell Scripting question involving ping
 
Hello! As the topic states I'm making a script that will do the following things on boot from a livecd:
  • Assign itself an IP address
  • Ping the machines on the network and find the missing IP address
  • Once the missing IP address is found, the machine with the livecd inside will assume that IP

Currently I have a workaround where the livecd mounts the partition of the machine and searches for specific files within that partition. If it finds a file, then it takes the IP address of the machine that I assigned for it. This method can become annoying as I will then have to create specific files for each computer and add more lines to the script if I ever want to add more computers to the network.

My Question: Is there any other way to find if a computer is online other then grep/parsing through the ping output?

unSpawn 07-29-2008 10:01 AM

Maybe I'm missing something here, but can't you just use DHCP to assign IP addresses? I mean the MAC address doesn't change, so?

trickykid 07-29-2008 10:05 AM

Quote:

Originally Posted by jhilton (Post 3229855)
My Question: Is there any other way to find if a computer is online other then grep/parsing through the ping output?

I agree with unSpawn about the DHCP, you can assign specific IP's bound by their MAC Addresses.

As for the finding computers online, nmap is a good tool to see what's online rather than using ping.

jhilton 07-29-2008 10:16 AM

Haha, wow. I honestly didn't think of/completely forgot about DHCP. This should make things alot easier for me. Thanks!


All times are GMT -5. The time now is 10:15 PM.