2015-04-28 14:34:51 +00:00
|
|
|
#!/sbin/openrc-run
|
2022-11-05 16:00:25 +01:00
|
|
|
|
|
|
|
name="hostapd"
|
|
|
|
description="User space daemon for access point and authentication servers"
|
2009-11-30 13:21:42 +00:00
|
|
|
|
2012-01-19 09:25:09 +00:00
|
|
|
extra_started_commands="reload"
|
2022-11-05 16:00:25 +01:00
|
|
|
|
|
|
|
# $CONFIGS and $OPTIONS are deprecated since Alpine v3.17.
|
|
|
|
# NOTE: cfgfile can contain more than one file path in this case.
|
|
|
|
: ${cfgfile:=${CONFIGS:-"/etc/hostapd/hostapd.conf"}}
|
|
|
|
|
2022-11-02 16:52:13 +09:00
|
|
|
command="/usr/sbin/hostapd"
|
2022-11-05 16:00:25 +01:00
|
|
|
command_args="${command_args:-$OPTIONS} $cfgfile"
|
|
|
|
command_background="yes"
|
2022-11-02 16:52:13 +09:00
|
|
|
pidfile="/run/$RC_SVCNAME.pid"
|
2009-11-30 13:21:42 +00:00
|
|
|
|
2022-11-05 16:00:25 +01:00
|
|
|
required_files="$cfgfile"
|
|
|
|
|
2009-11-30 13:21:42 +00:00
|
|
|
depend() {
|
|
|
|
need net
|
|
|
|
after firewall
|
|
|
|
use logger
|
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
2022-11-05 16:00:25 +01:00
|
|
|
ebegin "Reloading $name configuration"
|
2009-11-30 13:21:42 +00:00
|
|
|
|
2022-11-02 16:52:13 +09:00
|
|
|
if [ "$supervisor" ]; then
|
|
|
|
$supervisor "$RC_SVCNAME" --signal HUP
|
|
|
|
else
|
|
|
|
start-stop-daemon --signal HUP --pidfile "$pidfile"
|
|
|
|
fi
|
2009-11-30 13:21:42 +00:00
|
|
|
eend $?
|
|
|
|
}
|