Re: What changed in rc.d infrastructure in last months?

From: NGie Cooper <yaneurabeya_at_gmail.com>
Date: Sun, 25 Oct 2015 12:39:51 -0700
> On Oct 25, 2015, at 12:30, NGie Cooper <yaneurabeya_at_gmail.com> wrote:

…

> 445 # hostapif if
> 446 #       Returns 0 if the interface is a HOSTAP interface and 1 otherwise.
> 447 hostapif()
> 448 {
> 449         local _tmpargs _arg
> 450         _tmpargs=`_ifconfig_getargs $1`
> 451 
> 452         for _arg in $_tmpargs; do
> 453                 case $_arg in
> 454                 [Hh][Oo][Ss][Tt][Aa][Pp])
> 455                         return 0
> 456                         ;;
> 457                 esac
> 458         done
> 459 
> 460         return 1
> 461 }

Here’s an example of how this works, by the way:

$ sh find_hostapifs.sh
wlan1 is!
$ cat find_hostapifs.sh
. /etc/rc.subr
load_rc_config

. /etc/network.subr
for i in em0 wlan0 wlan1; do
        hostapif $i && echo "$i is!”
done
$ grep ^ifconfig /etc/rc.conf
ifconfig_em0="inet W.X.Y.Z netmask 255.255.255.0"
ifconfig_em0_ipv6="inet6 accept_rtadv"
ifconfig_wlan0="inet 127.0.0.2/8"
ifconfig_wlan1=“hostap”
$

It’s documented here:

                 On the other hand, if you want to configure your wireless
                 interface with hostapd(8), you need to add ``HOSTAP'' to the
                 ifconfig_<interface> variable.  hostapd(8) will use the
                 settings from /etc/hostapd-<interface>.conf

Cheers,
-NGie
Received on Sun Oct 25 2015 - 18:39:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:00 UTC