diff options
author | PÁLI Gábor János <pali.gabor@gmail.com> | 2022-12-30 14:47:25 +0100 |
---|---|---|
committer | PÁLI Gábor János <pali.gabor@gmail.com> | 2022-12-30 14:47:25 +0100 |
commit | 1c1b02874e1749d61b9b1680f744bf8470147416 (patch) | |
tree | 90578f8f7b73792dd41129b71bc73b0eefd81d32 /aports/hostapd/hostapd.initd | |
parent | 1b300a88b562f707ccd1b67229bd878930c9766c (diff) | |
download | freebsd-wifibox-alpine-1c1b02874e1749d61b9b1680f744bf8470147416.zip |
Move to Linux 5.15.85 + Alpine 3.17.0.
Diffstat (limited to 'aports/hostapd/hostapd.initd')
-rw-r--r-- | aports/hostapd/hostapd.initd | 52 |
1 files changed, 20 insertions, 32 deletions
diff --git a/aports/hostapd/hostapd.initd b/aports/hostapd/hostapd.initd index 7813fd1..a7b6033 100644 --- a/aports/hostapd/hostapd.initd +++ b/aports/hostapd/hostapd.initd @@ -1,46 +1,34 @@ #!/sbin/openrc-run -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/hostapd/files/hostapd-0.6.9-init.d,v 1.2 2009/05/17 10:18:18 gurligebis Exp $ + +name="hostapd" +description="User space daemon for access point and authentication servers" extra_started_commands="reload" +# $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"}} + +command="/usr/sbin/hostapd" +command_args="${command_args:-$OPTIONS} $cfgfile" +command_background="yes" +pidfile="/run/$RC_SVCNAME.pid" + +required_files="$cfgfile" + depend() { need net after firewall use logger } -checkconfig() { - local file - - for file in ${CONFIGS}; do - if [ ! -r "${file}" ]; then - eerror "hostapd configuration file (${CONFIG}) not found" - return 1 - fi - done -} - -start() { - checkconfig || return 1 - - ebegin "Starting ${SVCNAME}" - start-stop-daemon --start --exec /usr/sbin/hostapd \ - -- -B ${OPTIONS} ${CONFIGS} - eend $? -} - -stop() { - ebegin "Stopping ${SVCNAME}" - start-stop-daemon --stop --exec /usr/sbin/hostapd - eend $? -} - reload() { - checkconfig || return 1 + ebegin "Reloading $name configuration" - ebegin "Reloading ${SVCNAME} configuration" - kill -HUP $(pidof /usr/sbin/hostapd) > /dev/null 2>&1 + if [ "$supervisor" ]; then + $supervisor "$RC_SVCNAME" --signal HUP + else + start-stop-daemon --signal HUP --pidfile "$pidfile" + fi eend $? } |