[CLUE-Tech] dhclient at boot?

Keith Hellman kehellman at yahoo.com
Tue Apr 23 09:10:03 MDT 2002


Dave:

Completely untested, but something like this should work 99.999% of the
time.

dhclient <dhclient_params>
/sbin/ifconfig eth0 |grep 'inet addr:[0-9]*.[0-9]*.[0-9]*.[0-9]*'
>/dev/null
if [ ! $? -eq 0 ]; then
	# dhclient failed
	/sbin/ifconfig eth0 <static_params>
fi
echo eth0 is $(/sbin/ifconfig eth0 |grep 'inet
addr:[0-9]*.[0-9]*.[0-9]*.[0-9]*') 

--- Dave Price <davep at kinaole.org> wrote:
> Hi,
> 
> I have a laptop running debian woody.  I can do dhcp networking okay,
> but I need to run
> dhclient by hand as root whenever i reboot.
> 
> In truth, this system is usually used in dhcp environments, and
> on those occasions when dhcp is not available, I have a
> reserved static configuration that will work consistantly.
> 
> can anyone suggest a nice way to handle this 'logic' in a
> startup script?
> 
> i.e.
> 
> try dhclient, if fail, then set eth0 manually ...
> 
> aloha (and TIA)
> dave
> 

> ATTACHMENT part 2 application/pgp-signature 



=====
Keith E. Hellman
kehellman at yahoo.com

__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/



More information about the clue-tech mailing list