From 1c1b02874e1749d61b9b1680f744bf8470147416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=81LI=20G=C3=A1bor=20J=C3=A1nos?= Date: Fri, 30 Dec 2022 14:47:25 +0100 Subject: Move to Linux 5.15.85 + Alpine 3.17.0. --- aports/hostapd/hostapd.initd | 52 +++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 32 deletions(-) (limited to 'aports/hostapd/hostapd.initd') 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 $? } -- cgit v1.2.3