aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-04-18 00:56:26 +0000
committerRoy Marples <roy@marples.name>2009-04-18 00:56:26 +0000
commit1a2d81751d144889bfd5e1e38c13d2c3c5fad237 (patch)
treea989c1afdd38665d21c7b3e91deb87d51209dc34
parentc9e24a0494dc499728e5131d15a8a16d3fd97c5d (diff)
Support BSDs
-rw-r--r--init.d.misc/wpa_supplicant.in27
1 files changed, 21 insertions, 6 deletions
diff --git a/init.d.misc/wpa_supplicant.in b/init.d.misc/wpa_supplicant.in
index 562a4999..951d82f6 100644
--- a/init.d.misc/wpa_supplicant.in
+++ b/init.d.misc/wpa_supplicant.in
@@ -20,12 +20,27 @@ find_wireless()
{
local iface=
- for iface in /sys/class/net/*; do
- if [ -e "${iface}"/wireless ]; then
- echo "${iface##*/}"
- return 0
- fi
- done
+ case "${RC_UNAME}" in
+ Linux)
+ for iface in /sys/class/net/*; do
+ if [ -e "${iface}"/wireless ]; then
+ echo "${iface##*/}"
+ return 0
+ fi
+ done
+ ;;
+ *)
+ for iface in /dev/net/* $(ifconfig -l 2>/dev/null); do
+ if ifconfig "${iface##*/}" 2>/dev/null | \
+ grep -q "[ ]*ssid "
+ then
+ echo "${iface##*/}"
+ return 0
+ fi
+ done
+ ;;
+ esac
+
return 1
}