home *** CD-ROM | disk | FTP | other *** search
/ HAKERIS 11 / HAKERIS 11.ISO / linux / system / LinuxConsole 0.4 / linuxconsole0.4install-en.iso / linuxconsole0.4.lcm / etc / hotplug / wlan.agent < prev   
Encoding:
Text File  |  2004-03-26  |  1.6 KB  |  80 lines

  1. #!/bin/bash
  2. #
  3. # p80211/wlan hotplug policy agent.
  4. #
  5. # wlan hotplug params include:
  6. #    
  7. #    ACTION=%s [register|remove|shutdown|startup|suspend|resume]
  8. #    INTERFACE=%s
  9. #       NSDNAME=%s
  10. #
  11.  
  12. cd /etc/hotplug
  13. . hotplug.functions
  14.  
  15. #DEBUG=yes export DEBUG
  16.  
  17. if [ "$INTERFACE" = "" ]; then
  18.     mesg Bad WLAN invocation: \$INTERFACE is not set
  19.     exit 1
  20. fi
  21.  
  22. if [ "$NSDNAME" = "" ]; then
  23.     mesg Bad WLAN invocation: \$NSDNAME is not set
  24.     exit 1
  25. fi
  26.  
  27. debug_mesg WLAN $ACTION on $INTERFACE \($NSDNAME\)
  28.  
  29. if [ "$NSDNAME" = "prism2_cs" ] ; then
  30.     mesg "WLAN Hotplug bypassed for pcmcia"
  31.     exit 0
  32. fi
  33.  
  34. # load up the shared scripts
  35. if [ ! -f /etc/wlan/shared ] ; then
  36.     mesg "/etc/wlan/shared not present, aborting"
  37.     exit 1
  38. fi
  39.  
  40. ECHO=mesg
  41. . /etc/wlan/shared
  42.  
  43. case $ACTION in
  44. 'register'|'resume')
  45.     debug_mesg WLAN $INTERFACE registered.
  46.     wlan_bring_it_up $INTERFACE
  47.     if [ $? = 0 ] ; then
  48.         mesg WLAN $INTERFACE brought up successfully.
  49.         if [ -x /etc/wlan/pre-ifup ] ; then
  50.             # pre-ifup is presumed to call ifup if it
  51.             #  wants to...it may choose to skip it.
  52.             mesg "WLAN bringing up layer 3+ with /etc/wlan/pre-ifup"
  53.             /etc/wlan/pre-ifup $INTERFACE
  54.         else
  55.             mesg "WLAN bringing up layer 3+ with /sbin/ifup"
  56.             /sbin/ifup $INTERFACE
  57.         fi
  58.     else
  59.         mesg WLAN Could not bring up $INTERFACE
  60.     fi
  61.     # eventually invoke net.agent on $INTERFACE w/ REGISTER
  62. ;;
  63. 'remove'|'suspend')
  64.     debug_mesg WLAN $INTERFACE removed.
  65. ;;
  66. 'startup')
  67.     # kick off wland.
  68.     debug_mesg WLAN p80211 starting!
  69.     start_wland
  70. ;;
  71. 'shutdown')
  72.     debug_mesg WLAN p80211 shutting down!
  73.     stop_wland
  74. ;;
  75. *)
  76.     debug_mesg WLAN $ACTION event not supported
  77.     exit 1 ;;
  78.  
  79. esac
  80.