xref: /netbsd-src/etc/rc.d/wpa_supplicant (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1#!/bin/sh
2#
3# $NetBSD: wpa_supplicant,v 1.5 2014/01/23 07:26:51 spz Exp $
4#
5
6# PROVIDE: wpa_supplicant
7# REQUIRE: network mountcritlocal
8# BEFORE:  NETWORKING dhclient
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}
33
34load_rc_config $name
35run_rc_command "$1"
36