kernel - Make certain sysctl's unlocked
[dragonfly.git] / etc / rc.d / wpa_supplicant
blobcfa3c32a8b6cbbc52f7266af21a4e50edb9d3a88
1 #!/bin/sh
3 # $FreeBSD: src/etc/rc.d/wpa_supplicant,v 1.2 2005/10/19 22:26:47 jkim Exp $
6 # PROVIDE: wpa_supplicant
7 # REQUIRE: mountcritremote
8 # KEYWORD: nojail nostart
10 . /etc/rc.subr
11 . /etc/network.subr
13 name="wpa_supplicant"
14 rcvar=
15 command="/usr/sbin/wpa_supplicant"
16 conf_file="/etc/wpa_supplicant.conf"
18 start_precmd="wpa_supplicant_precmd"
19 wpa_supplicant_precmd()
21 ifconfig $ifn up
23 start_postcmd="wpa_supplicant_postcmd"
24 wpa_supplicant_postcmd()
26 # don't wait for wpa_supplicant to associate
27 # while ! ifconfig $ifn | grep -qw "status: associated"; do
28 # sleep 1
29 # done
30 if [ "${command}" = "/usr/sbin/wpa_supplicant" ];
31 then
32 cat << EOF
33 ==============================================================
34 = WARNING * SECURITY * WARNING =
35 ==============================================================
37 The base wpa_supplicant is running. This version is several releases behind
38 and is not patched for security vulnerabilities. It is highly recommended
39 that the DPorts version be run instead. Instructions to switch here:
41 http://www.dragonflybsd.org/docs/docs/newhandbook/WirelessNetwork/#index1h2
43 EOF
44 sleep 10
48 ifn="$2"
49 if [ -z "$ifn" ]; then
50 return 1
53 is_ndis_interface()
55 case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in
56 ndis*) true ;;
57 *) false ;;
58 esac
61 if is_ndis_interface ${ifn}; then
62 driver="ndis"
63 else
64 driver="bsd"
67 load_rc_config $name
69 pid_file="/var/run/${name}/${ifn}.pid"
70 command_args="-B -q -i $ifn -c $conf_file -D $driver -P $pid_file"
71 required_files=$conf_file
73 run_rc_command "$1"