diff --git a/etc/rc.d/hostapd b/etc/rc.d/hostapd index d0c2d88f2ff..43c6cf4e480 100755 --- a/etc/rc.d/hostapd +++ b/etc/rc.d/hostapd @@ -13,15 +13,27 @@ name="hostapd" desc="Authenticator for IEEE 802.11 networks" command="/usr/sbin/${name}" -ifn="$2" -if [ -z "$ifn" ]; then - rcvar="hostapd_enable" - conf_file="/etc/${name}.conf" - pidfile="/var/run/${name}.pid" +load_rc_config ${name} + + +if [ -n "$hostapd_ifaces" ]; then + nl_hostapd_ifaces=`(echo $hostapd_ifaces | tr '\s+' '\n')` + for iface in $nl_hostapd_ifaces + do + conf_file="/etc/${name}-${iface}.conf $conf_file" + done + pidfile="/var/run/${name}.pid" else - rcvar= - conf_file="/etc/${name}-${ifn}.conf" - pidfile="/var/run/${name}-${ifn}.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 fi command_args="-P ${pidfile} -B ${conf_file}" @@ -29,5 +41,4 @@ required_files="${conf_file}" required_modules="wlan_xauth wlan_wep wlan_tkip wlan_ccmp" extra_commands="reload" -load_rc_config ${name} run_rc_command "$1" diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index a03f4de5cb9..3484c058146 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -409,6 +409,11 @@ Set to to start .Xr hostapd 8 at system boot time. +.It Va hostapd_ifaces +.Pq Vt str +Space separated list of interfaces managed by +.Xr hostapd 8 +when in hostap mode. .It Va hostname .Pq Vt str The fully qualified domain name (FQDN) of this host on the network.