xref: /freebsd-13.1/libexec/rc/rc.d/hostapd (revision 704945b0)
10696600cSBjoern A. Zeeb#!/bin/sh
20696600cSBjoern A. Zeeb#
30696600cSBjoern A. Zeeb# $FreeBSD$
40696600cSBjoern A. Zeeb#
50696600cSBjoern A. Zeeb
60696600cSBjoern A. Zeeb# PROVIDE: hostapd
70696600cSBjoern A. Zeeb# REQUIRE: mountcritremote
80696600cSBjoern A. Zeeb# KEYWORD: nojail shutdown
90696600cSBjoern A. Zeeb
100696600cSBjoern A. Zeeb. /etc/rc.subr
110696600cSBjoern A. Zeeb
120696600cSBjoern A. Zeebname="hostapd"
130696600cSBjoern A. Zeebdesc="Authenticator for IEEE 802.11 networks"
142b951e9cSCy Schubertcommand=${hostapd_program}
15*704945b0SCy Schubertstart_postcmd="hostapd_poststart"
16*704945b0SCy Schubert
17*704945b0SCy Schuberthostapd_poststart() {
18*704945b0SCy Schubert	ifconfig ${ifn} down
19*704945b0SCy Schubert	sleep 2
20*704945b0SCy Schubert	ifconfig ${ifn} up
21*704945b0SCy Schubert}
220696600cSBjoern A. Zeeb
230696600cSBjoern A. Zeebifn="$2"
240696600cSBjoern A. Zeebif [ -z "$ifn" ]; then
250696600cSBjoern A. Zeeb	rcvar="hostapd_enable"
260696600cSBjoern A. Zeeb	conf_file="/etc/${name}.conf"
270696600cSBjoern A. Zeeb	pidfile="/var/run/${name}.pid"
280696600cSBjoern A. Zeebelse
290696600cSBjoern A. Zeeb	rcvar=
300696600cSBjoern A. Zeeb	conf_file="/etc/${name}-${ifn}.conf"
310696600cSBjoern A. Zeeb	pidfile="/var/run/${name}-${ifn}.pid"
320696600cSBjoern A. Zeebfi
330696600cSBjoern A. Zeeb
340696600cSBjoern A. Zeebcommand_args="-P ${pidfile} -B ${conf_file}"
350696600cSBjoern A. Zeebrequired_files="${conf_file}"
360696600cSBjoern A. Zeebrequired_modules="wlan_xauth wlan_wep wlan_tkip wlan_ccmp"
370696600cSBjoern A. Zeebextra_commands="reload"
380696600cSBjoern A. Zeeb
390696600cSBjoern A. Zeebload_rc_config ${name}
400696600cSBjoern A. Zeebrun_rc_command "$1"
41