home bbs files messages ]

Just a sample of the Echomail archive

Cooperative anarchy at its finest, still active today. Darkrealms is the Zone 1 Hub.

   TUXPOWER      Advocacy for the Linux operating system      1,237 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 10 of 1,237   
   Maurice Kinal to All   
   wireless_client.sh   
   20 Apr 11 04:48:30   
   
   #!/bin/bash   
   ###### example wireless client script for ath9k kernel driver   
   ###### REQUIRES: modularized ath9k driver, iproute2, wireless_tools,   
   ######           and wpa_supplicant   
   ###### PURPOSE:  enables connectivity to a wireless router with WPA2   
   ######           authentication.   
      
   wireless_interface="wlan0"   
   client_address="192.168.192.2/24"   
      
   case "${1}" in   
      
     start)   
       if [ ! "$(lsmod | grep ath9k)" ]   
       then   
         modprobe ath9k   
         sleep 2   
       fi   
       if [ "$(find /proc/ -name $wireless_interface)" ]   
       then   
         ip link set $wireless_interface up   
         iwconfig $wireless_interface power off   
         if [ "$(iwlist $wireless_interface scan essid "smrfish")" ]   
         then   
   	iwconfig $wireless_interface essid "smrfish"   
   	ip addr add $client_address dev $wireless_interface   
   	wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B   
         else   
   	echo -e "smrfish is unreachable\a"   
   	ip link set $wireless_interface down   
   	modprobe -r ath9k   
         fi   
       else   
         echo -e "No useable wireless interface\a"   
         modprobe -r ath9k   
       fi   
       ;;   
      
       stop)   
         if [ "$(ip addr show $wireless_interface | grep -o "state UP")" ]   
         then   
   	killall wpa_supplicant   
   	ip addr del $client_address dev $wireless_interface   
   	ip link set $wireless_interface down   
   	modprobe -r ath9k   
         fi   
         ;;   
      
     *)   
       echo "Usage: ${0} {start|stop}"   
       exit 1   
       ;;   
      
   esac   
   --- WeBeBashing with 'hpt post'   
    * Origin: Pointy Stick Society (1:261/38.9)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca