#!/bin/sh
#Barry Kauler, LGPL 2007
#my own ad-hoc script! for puppy 2.17

[ ! $1 ] && exit

WLANMOD="`lsmod | grep -E '^prism2_pci|^prism2_plx|^prism2_usb' | head -n 1`"

if [ "$WLANMOD" != "" ];then

 action=$1

 case "$action" in

  start)

     wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable
     #wlanctl-ng wlan0 lnxreq_autojoin ssid=<your APs SSID> authtype=opensystem
     #ifconfig wlan0 <yourIP> netmask <yourNetmask> broadcast <yourBroadcast>
     #route add default gw <yourGateway>
     ;;
     
  stop)
  
     wlanctl-ng wlan0 lnxreq_ifstate ifstate=disable
     ifconfig wlan0 down
     modprobe -r $WLANMOD
     modprobe -r p80211
		
     ;;
 esac
     
fi

###END###
