]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - etc/rc.d/wpa_supplicant
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / etc / rc.d / wpa_supplicant
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: wpa_supplicant
7 # REQUIRE: mountcritremote
8 # KEYWORD: nojail nostart
9
10 . /etc/rc.subr
11 . /etc/network.subr
12
13 name="wpa_supplicant"
14 rcvar=
15
16 ifn="$2"
17 if [ -z "$ifn" ]; then
18         return 1
19 fi
20
21 is_ndis_interface()
22 {
23         case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in
24                 ndis*) true ;;
25                 *) false ;;
26         esac
27 }
28
29 if is_wired_interface ${ifn} ; then
30         driver="wired"
31 elif is_ndis_interface ${ifn} ; then
32         driver="ndis"
33 else
34         driver="bsd"
35 fi
36
37 load_rc_config $name
38
39 command=${wpa_supplicant_program}
40 conf_file=${wpa_supplicant_conf_file}
41 pidfile="/var/run/${name}/${ifn}.pid"
42 command_args="-B -i $ifn -c $conf_file -D $driver -P $pidfile"
43 required_files=$conf_file
44 required_modules="wlan_wep wlan_tkip wlan_ccmp"
45
46 run_rc_command "$1"