[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Slightly newer airport sleep bits for pmud



Hey all, after talking to someone else, I found out not everyone has their
airport modules loaded with autoclean, So I've appended my current version
of the script I use which should work around this.  And I moved it into
/etc/power/pwrctl-local since no official kernels support sleep yet on these
machines.  Here it is:

logger=/usr/bin/logger

case "$1" in
sleep)
        # Currently the airport driver isn't happy with sleep, so we
        # must remove it
        if [ "`lsmod | grep airport 2>/dev/null`" ]; then
                AIRPORT=`cat /proc/net/wireless | grep eth | sed 's/^  //' | cut -d : -f 1`
                ifdown $AIRPORT
                tempfile -n /var/run/airport || {
                        $logger -p daemon.error -t pwrctl "$0: cannot create tempfile"
                        exit 1
                }
                echo $AIRPORT > /var/run/airport
                # Make sure we get airport, even if it's not autoprobed.
                rmmod airport && rmmod orinoco && rmmod hermes
        fi
;;
wakeup)
        [ -f /var/run/airport ] && {
                modprobe -k airport
                ifup `cat /var/run/airport`
                rm /var/run/airport
        }
;;
*)
;;
esac

-- 
Tom Rini (TR1265)
http://gate.crashing.org/~trini/



Reply to: