runwpa 432 B

123456789101112131415161718
  1. #!/bin/bash
  2. if [ "`which iwconfig`" = "" ] ; then
  3. echo "WARNING:Wireless tool (iwconfig) not exist!"
  4. echo " Please install it!"
  5. exit
  6. else
  7. if [ `uname -r | cut -d. -f2` -eq 4 ]; then
  8. wpa_supplicant -D ipw -c wpa1.conf -i wlan0
  9. else
  10. if [ `iwconfig -v |awk '{print $4}' | head -n 1` -lt 18 ] ; then
  11. wpa_supplicant -D ipw -c wpa1.conf -i wlan0
  12. else
  13. wpa_supplicant -D wext -c wpa1.conf -i wlan0
  14. fi
  15. fi
  16. fi