PDA

View Full Version : wpa_supplicant.conf entry for any?


Jeff Sadowski
2005-07-19, 12:41 PM CDT
Ok I have wpa_supplicant working good on my known networks. Now I want to do something stupid. Yea well you know how it is I want to dumb down and all.
Anyways I want it to try and find my trusted networks first like it is already doing and then
after all my trusted networks fail because I'm no where near them to have it try and connect to any unencrypted ones. Do I need to put an entry in wpa_supplicant.conf to do this.
And what kind of entry?
maybe like so?

network={
ssid=""
key_mgmt=NONE
}

well anyways I'd also like to share my additions to my /etc/sysconfig/network-scripts/ifup-wireless I got the idea to put it in this file from Butt-Ugly thanks But I think I cleaned it up a little since I use both a ndiswrapper card and a madwifi card also I would rather shutdown wpa_supplicant with wpa_cli instead of kill
I'm still looking for a better way to get the driver info from the $DEVICE name
like maybe some info from /proc that might associate what driver is being used to supply
the $DEVICE node. If anyone knows what files associate that kind of info I'd be very gratefull thanks.

echo -e \\n\\nInitialising \'wpa_supplicant\' WIFI Security....\\n
case "`echo $DEVICE|sed 's/[0-9]$//'`" in
ath)
DRIVER=madwifi
;;
wlan)
DRIVER=ndiswrapper
;;
eth)
DRIVER=hermes
;;
*)
DRIVER=unknown
;;
esac

if [ "$DRIVER" = "unknown" ];then
echo "I don't know what driver to use for $DEVICE with wpa_supplicant please add an entry to $0 in the wpa_supplicant section"
else
/usr/local/sbin/wpa_cli terminate 2>/dev/null
/usr/local/sbin/wpa_supplicant -Bdw -i $DEVICE -c /etc/wpa_supplicant.conf -D $DRIVER
fi