xref: /freebsd/libexec/rc/rc.d/wpa_supplicant (revision d5b0e70f7e04d971691517ce1304d86a1e367e2e)
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
13name="wpa_supplicant"
14desc="WPA/802.11i Supplicant for wireless network devices"
15start_postcmd="wpa_poststart"
16rcvar=
17
18ifn="$2"
19if [ -z "$ifn" ]; then
20	return 1
21fi
22
23wpa_poststart() {
24	ifconfig ${ifn} down
25	ifconfig ${ifn} up
26}
27
28if is_wired_interface ${ifn} ; then
29	driver="wired"
30else
31	driver="bsd"
32fi
33
34load_rc_config $name
35
36command=${wpa_supplicant_program}
37conf_file=${wpa_supplicant_conf_file}
38pidfile="/var/run/${name}/${ifn}.pid"
39command_args="-B -i $ifn -c $conf_file -D $driver -P $pidfile"
40required_files=$conf_file
41required_modules="wlan_wep wlan_tkip wlan_ccmp"
42
43run_rc_command "$1"
44