[ltp] Disabling WLAN when it's not used

Rene Cunningham linux-thinkpad@linux-thinkpad.org
Sun, 30 May 2004 22:04:47 +1000


On Sun, May 30, 2004 at 02:37:36AM +0200, Edi Weitz wrote:
> And if so, is there an automatic way (as opposed to issuing
> ifdown manually) to disable the card once it hasn't found a DHCP
> server?

/etc/dhclient-enter-hooks is a bash script which is invoked by dhclient.
dhclient defines a few variables that can be used within this script to
do some pretty handy stuff.

Your /etc/dhclient-enter-hooks script may look something like

#!/bin/sh

if [ x$reason = xFAIL ] || [ x$reason = xTIMEOUT ]; then
    /etc/init.d/pcmcia stop
fi

man dhclient-script, for more information ofcourse :)

-- 

Rene Cunningham
DCLabs Pty Ltd
http://www.dclabs.com.au
----------------------------------------
Clones are people two.