xref: /netbsd-src/etc/rc.d/wpa_supplicant (revision 0a9098d00fea89c48d26e8ec45087bd0ec34e0c8)
1#!/bin/sh
2#
3# $NetBSD: wpa_supplicant,v 1.9 2020/09/08 12:52:18 martin Exp $
4#
5
6# PROVIDE: wpa_supplicant
7# REQUIRE: network CRITLOCALMOUNTED
8# BEFORE:  NETWORKING dhcpcd
9#
10#	We need to run a command that resides in /usr/sbin, and the
11#	/usr file system is traditionally mounted by mountcritremote.
12#	However, we cannot depend on mountcritremote, because that
13#	would introduce a circular dependency.	Therefore, if you need
14#	wpa_supplicant to start during the boot process, you should
15#	ensure that the /usr file system is mounted by mountcritlocal,
16#	not by mountcritremote.
17
18$_rc_subr_loaded . /etc/rc.subr
19
20name="wpa_supplicant"
21rcvar=$name
22command="/usr/sbin/wpa_supplicant"
23reload_cmd="/usr/sbin/wpa_cli reconfigure"
24extra_commands="reload"
25start_precmd="wpa_supplicant_precmd"
26
27wpa_supplicant_precmd()
28{
29    if [ ! -d /var/run/wpa_supplicant ]; then
30        mkdir -p -m 755 /var/run/wpa_supplicant
31    fi
32    rc_flags="-B $rc_flags"
33}
34
35load_rc_config $name
36run_rc_command "$1"
37