Add support for starting wpa_supplicant by adding the WPA keyword to an

interface's ifconfig_<ifn> entry in /etc/rc.conf.

Approved by:	re (network interface startup blanket)
This commit is contained in:
Brooks Davis 2005-06-30 04:52:47 +00:00
parent d3a260999d
commit a7e55c1e77
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147682
3 changed files with 32 additions and 3 deletions

View File

@ -48,7 +48,7 @@ ifconfig_up()
fi
if wpaif $1; then
#/etc/rc.d/wpa_supplicant start $1
/etc/rc.d/wpa_supplicant start $1
_cfg=0 # XXX: not sure this should count
fi
@ -89,7 +89,7 @@ ifconfig_down()
IFS="$oldifs"
if wpaif $1; then
#/etc/rc.d/wpa_supplicant stop $1
/etc/rc.d/wpa_supplicant stop $1
_cfg=0
fi

View File

@ -36,7 +36,7 @@ FILES= DAEMON LOGIN NETWORKING SERVERS \
timed tmp \
ugidfw usbd \
var virecover \
watchdogd \
watchdogd wpa_supplicant \
ypbind yppasswdd ypserv \
ypset ypupdated ypxfrd
FILESDIR= /etc/rc.d

29
etc/rc.d/wpa_supplicant Normal file
View File

@ -0,0 +1,29 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: wpa_supplicant
# REQUIRE: mountcritremote
# KEYWORD: nojail nostart
. /etc/rc.subr
. /etc/network.subr
name="wpa_supplicant"
rcvar=
command="/usr/sbin/${name}"
conf_file="/etc/wpa_supplicant.conf"
ifn="$2"
if [ -z "$ifn" ]; then
return 1
fi
load_rc_config $name
pid_file="/var/run/${name}/${ifn}.pid"
command_args="-B -q -i $ifn -P $pid_file -c $conf_file"
required_files=$conf_file
run_rc_command "$1"