11.1Srpaulo#!/bin/sh
21.1Srpaulo#
31.9Smartin# $NetBSD: wpa_supplicant,v 1.9 2020/09/08 12:52:18 martin Exp $
41.1Srpaulo#
51.1Srpaulo
61.1Srpaulo# PROVIDE: wpa_supplicant
71.9Smartin# REQUIRE: network CRITLOCALMOUNTED
81.7Sroy# BEFORE:  NETWORKING dhcpcd
91.3Sapb#
101.3Sapb#	We need to run a command that resides in /usr/sbin, and the
111.3Sapb#	/usr file system is traditionally mounted by mountcritremote.
121.3Sapb#	However, we cannot depend on mountcritremote, because that
131.3Sapb#	would introduce a circular dependency.	Therefore, if you need
141.3Sapb#	wpa_supplicant to start during the boot process, you should
151.3Sapb#	ensure that the /usr file system is mounted by mountcritlocal,
161.3Sapb#	not by mountcritremote.
171.1Srpaulo
181.1Srpaulo$_rc_subr_loaded . /etc/rc.subr
191.1Srpaulo
201.1Srpauloname="wpa_supplicant"
211.1Srpaulorcvar=$name
221.1Srpaulocommand="/usr/sbin/wpa_supplicant"
231.4Stronreload_cmd="/usr/sbin/wpa_cli reconfigure"
241.2Sabsextra_commands="reload"
251.5Sspzstart_precmd="wpa_supplicant_precmd"
261.5Sspz
271.5Sspzwpa_supplicant_precmd()
281.5Sspz{
291.5Sspz    if [ ! -d /var/run/wpa_supplicant ]; then
301.5Sspz        mkdir -p -m 755 /var/run/wpa_supplicant
311.5Sspz    fi
321.6Sjmcneill    rc_flags="-B $rc_flags"
331.5Sspz}
341.1Srpaulo
351.1Srpauloload_rc_config $name
361.1Srpaulorun_rc_command "$1"
37