summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2013-06-26 04:00:52 +0000
committerrpaulo <rpaulo@FreeBSD.org>2013-06-26 04:00:52 +0000
commit5d588b2eef337c7d94616bb7f500e5b563f70733 (patch)
tree7ab112f8fb75b8facd61167713cf1d4cf58bcd06 /etc/rc.d
parent3572acf51251da8e1bbed46ebcead07acbc8c900 (diff)
downloadFreeBSD-src-5d588b2eef337c7d94616bb7f500e5b563f70733.zip
FreeBSD-src-5d588b2eef337c7d94616bb7f500e5b563f70733.tar.gz
Implement ifconfig_wlanX="HOSTAP".
Not only this is a bit cleaner, it allows multiple instances of hostapd to be running on the system host, useful for simultaneous dual-band WiFi. This is similar to ifconfig_wlanX="WPA" but it uses /etc/hostapd-wlanX.conf. Compatibility with hostapd_enable=YES/NO was kept. Reviewed by: adrian
Diffstat (limited to 'etc/rc.d')
-rwxr-xr-xetc/rc.d/hostapd13
1 files changed, 10 insertions, 3 deletions
diff --git a/etc/rc.d/hostapd b/etc/rc.d/hostapd
index f65fcde..95d315b 100755
--- a/etc/rc.d/hostapd
+++ b/etc/rc.d/hostapd
@@ -10,11 +10,18 @@
. /etc/rc.subr
name="hostapd"
-rcvar="hostapd_enable"
command="/usr/sbin/${name}"
-conf_file="/etc/${name}.conf"
-pidfile="/var/run/${name}.pid"
+ifn="$2"
+if [ -z "$ifn" ]; then
+ rcvar="hostapd_enable"
+ conf_file="/etc/${name}.conf"
+ pidfile="/var/run/${name}.pid"
+else
+ rcvar=
+ conf_file="/etc/${name}-${ifn}.conf"
+ pidfile="/var/run/${name}-${ifn}.pid"
+fi
command_args="-P ${pidfile} -B ${conf_file}"
required_files="${conf_file}"
OpenPOWER on IntegriCloud