LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-29-2008, 09:30 AM   #1
jhilton
LQ Newbie
 
Registered: Jun 2008
Posts: 29

Rep: Reputation: 15
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?
 
Old 07-29-2008, 10:01 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,999
Blog Entries: 54

Rep: Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745
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?
 
Old 07-29-2008, 10:05 AM   #3
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally Posted by jhilton View Post
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.
 
Old 07-29-2008, 10:16 AM   #4
jhilton
LQ Newbie
 
Registered: Jun 2008
Posts: 29

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I have a shell scripting question bartock Linux - General 5 03-06-2008 02:46 PM
shell scripting question angelofhope Linux - Software 5 08-22-2007 04:18 PM
shell scripting question Komelore Linux - Software 3 03-12-2007 04:21 AM
Prob involving tcpdump + ping on liveCD uncle-c Linux - Newbie 6 03-05-2007 06:03 PM
a shell-scripting question: mrchaos Slackware 3 09-22-2005 11:00 AM


All times are GMT -5. The time now is 08:18 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration