mkinitrd.sh: Fix comment typo.
[dragonfly.git] / etc / rc.d / wpa_supplicant
blobbd5eeb84e11d9d111e731adf8860d39956fad670
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"
17 start_postcmd="wpa_supplicant_postcmd"
19 wpa_supplicant_postcmd()
21 if [ "${command}" = "/usr/sbin/wpa_supplicant" ];
22 then
23 cat << EOF
24 ==============================================================
25 = WARNING * SECURITY * WARNING =
26 ==============================================================
28 The base wpa_supplicant is running. This version is several releases behind
29 and is not patched for security vulnerabilities. It is highly recommended
30 that the DPorts version be run instead. Instructions to switch here:
32 http://www.dragonflybsd.org/docs/docs/newhandbook/WirelessNetwork/#index1h2
34 EOF
35 sleep 10
39 ifn="$2"
40 if [ -z "$ifn" ]; then
41 return 1
44 is_ndis_interface()
46 case `${SYSCTL_N} -q net.wlan.${1#wlan}.%parent` in
47 ndis*) true ;;
48 *) false ;;
49 esac
52 if is_ndis_interface ${ifn}; then
53 driver="ndis"
54 else
55 driver="bsd"
58 # For the moment, prefer the DPorts wpa_supplicant if it exists.
59 # Since '/etc/defaults/rc.conf' does not set 'wpa_supplicant_program',
60 # the following 'command' assignment is enough.
61 if [ -x "/usr/local/sbin/wpa_supplicant" ]; then
62 command="/usr/local/sbin/wpa_supplicant"
65 load_rc_config $name
67 pid_file="/var/run/${name}/${ifn}.pid"
68 command_args="-B -q -i $ifn -c $conf_file -D $driver -P $pid_file"
69 required_files=$conf_file
71 run_rc_command "$1"