Re: Test for configured ethX
- From: Stephane CHAZELAS <this.address@xxxxxxxxxx>
- Date: Thu, 29 Mar 2007 16:24:20 GMT
2007-03-28, 09:44(-08), CptDondo:
I have a machine that travels. I want to configure it differently when[...]
it is attached to a local network and when it is not.
So...
Is there an easy way to test if ethX (eth1 in my case) has received an
IP address via DHCP?
What I want is something like this:
Try to get a DHCP address
If you succeed, do the following
copy network database config file to our config
If you fail, do the following
copy local database config file to our config
start local mysqld
Nothing too complex.... But I can't seem to find a reliable test for the
DHCP assignment.
I would use dhclient-script hooks. See:
man dhclient-script
--
Stéphane
.
- References:
- Test for configured ethX
- From: CptDondo
- Test for configured ethX
- Prev by Date: Re: IPSec, IPTables, multiple subnets
- Next by Date: Re: Sending a "ping": Which (ICMP) ports must be open in firewall to receive answer ?
- Previous by thread: Test for configured ethX
- Next by thread: Any VPN client for RH linux to connect to office VPN server (Sonicwall)
- Index(es):
Relevant Pages
|