Added
Link Here
|
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 |
desc="WPA/802.11i Supplicant for wireless network devices" |
15 |
rcvar= |
16 |
|
17 |
ifn="$2" |
18 |
if [ -z "$ifn" ]; then |
19 |
return 1 |
20 |
fi |
21 |
|
22 |
is_ndis_interface() |
23 |
{ |
24 |
case `sysctl -n net.wlan.${1#wlan}.%parent 2>/dev/null` in |
25 |
ndis*) true ;; |
26 |
*) false ;; |
27 |
esac |
28 |
} |
29 |
|
30 |
if is_wired_interface ${ifn} ; then |
31 |
driver="wired" |
32 |
elif is_ndis_interface ${ifn} ; then |
33 |
driver="ndis" |
34 |
else |
35 |
driver="bsd" |
36 |
fi |
37 |
|
38 |
load_rc_config $name |
39 |
|
40 |
# |
41 |
# This portion of this rc.script is different from base. |
42 |
case ${command} in |
43 |
/usr/sbin/wpa_supplicant) # Assume user does not want base hostapd because |
44 |
# user specified WITHOUT_WIRELESS in make.conf |
45 |
# and /etc/defaults/rc.conf contains this value. |
46 |
unset command;; |
47 |
esac |
48 |
command=${wpa_supplicant_program:-%%PREFIX%%/sbin/wpa_supplicant} |
49 |
# End of differences from base. The rest of the file should remain the same. |
50 |
|
51 |
conf_file=${wpa_supplicant_conf_file} |
52 |
pidfile="/var/run/${name}/${ifn}.pid" |
53 |
command_args="-B -i $ifn -c $conf_file -D $driver -P $pidfile" |
54 |
required_files=$conf_file |
55 |
required_modules="wlan_wep wlan_tkip wlan_ccmp" |
56 |
|
57 |
run_rc_command "$1" |