3 # p80211/wlan hotplug policy agent.
5 # wlan hotplug params include:
7 # ACTION=%s [register|remove|shutdown|startup|suspend|resume]
13 # must have ./ here or busybox shell barfs
16 #DEBUG=yes export DEBUG
18 if [ "$INTERFACE" = "" ]; then
19 mesg Bad WLAN invocation: \$INTERFACE is not set
23 if [ "$NSDNAME" = "" ]; then
24 mesg Bad WLAN invocation: \$NSDNAME is not set
28 debug_mesg WLAN $ACTION on $INTERFACE \($NSDNAME\)
30 if [ "$NSDNAME" = "prism2_cs" ] ; then
31 mesg "WLAN Hotplug bypassed for pcmcia"
35 # load up the shared scripts
36 if [ ! -f /etc/wlan/shared ] ; then
37 mesg "/etc/wlan/shared not present, aborting"
46 eval 'WLAN_ENABLE=$ENABLE_'$INTERFACE
47 if ! is_true $WLAN_ENABLE ; then
48 mesg "WLAN $ACTION - interface $INTERFACE not enabled, aborting"
51 debug_mesg WLAN $INTERFACE registered.
52 wlan_bring_it_up $INTERFACE
54 mesg WLAN $INTERFACE brought up successfully.
55 if [ -x /etc/wlan/network ] ; then
56 mesg "WLAN bringing up layer 3+ with /etc/wlan/network"
57 /etc/wlan/network start $INTERFACE
58 elif [ -x /etc/wlan/pre-ifup ] ; then
59 # pre-ifup is presumed to call ifup if it
60 # wants to...it may choose to skip it.
61 mesg "WLAN bringing up layer 3+ with /etc/wlan/pre-ifup"
62 /etc/wlan/pre-ifup $INTERFACE
64 mesg "WLAN bringing up layer 3+ with /sbin/ifup"
68 mesg WLAN Could not bring up $INTERFACE
71 # eventually invoke net.agent on $INTERFACE w/ REGISTER
74 debug_mesg WLAN $INTERFACE removed.
75 eval 'WLAN_ENABLE=$ENABLE_'$INTERFACE
76 if ! is_true $WLAN_ENABLE ; then
77 mesg "WLAN $ACTION - interface $INTERFACE not enabled, aborting"
80 if [ -x /etc/wlan/network ] ; then
81 mesg "WLAN taking down layer 3+ with /etc/wlan/network"
82 /etc/wlan/network stop $INTERFACE
83 elif [ -x /etc/wlan/post-ifdown ] ; then
84 # post-ifdown is presumed to call ifdown if it
85 # wants to...it may choose to skip it.
86 mesg "WLAN taking down layer 3+ with /etc/wlan/post-ifdown"
87 /etc/wlan/post-ifdown $INTERFACE
89 mesg "WLAN taking down layer 3+ with /sbin/ifdown"
90 /sbin/ifdown $INTERFACE
92 wlan_disable $INTERFACE
96 debug_mesg WLAN p80211 starting!
100 debug_mesg WLAN p80211 shutting down!
104 debug_mesg WLAN $ACTION event not supported