Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Oct 2015 12:39:51 -0700
From:      NGie Cooper <yaneurabeya@gmail.com>
To:        lev@FreeBSD.org
Cc:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: What changed in rc.d infrastructure in last months?
Message-ID:  <28FF29D6-A2D9-46C0-A419-DB433BB9F54A@gmail.com>
In-Reply-To: <DA78289A-176E-44EF-A2A2-1CEE10DF54ED@gmail.com>
References:  <16610120144.20151025222025@serebryakov.spb.ru> <DA78289A-176E-44EF-A2A2-1CEE10DF54ED@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Oct 25, 2015, at 12:30, NGie Cooper <yaneurabeya@gmail.com> wrote:

=E2=80=A6

> 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=3D`_ifconfig_getargs $1`
> 451=20
> 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=20
> 460         return 1
> 461 }

Here=E2=80=99s 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!=E2=80=9D
done
$ grep ^ifconfig /etc/rc.conf
ifconfig_em0=3D"inet W.X.Y.Z netmask 255.255.255.0"
ifconfig_em0_ipv6=3D"inet6 accept_rtadv"
ifconfig_wlan0=3D"inet 127.0.0.2/8"
ifconfig_wlan1=3D=E2=80=9Chostap=E2=80=9D
$

It=E2=80=99s 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=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?28FF29D6-A2D9-46C0-A419-DB433BB9F54A>