aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2022-11-05 16:00:25 +0100
committerJakub Jirutka <jakub@jirutka.cz>2022-11-05 15:03:47 +0000
commit420d875c4d8cf332e8018aadd3f6d281320c2623 (patch)
treedb819f1436c56a87e1e56f27fd78752a333609e6
parent6caff535d9e5afd71b32e81ae4aef9eb8d509aff (diff)
main/hostapd: standardise init script
-rw-r--r--main/hostapd/APKBUILD4
-rw-r--r--main/hostapd/hostapd.confd13
-rw-r--r--main/hostapd/hostapd.initd35
3 files changed, 24 insertions, 28 deletions
diff --git a/main/hostapd/APKBUILD b/main/hostapd/APKBUILD
index 1c2c212d2f5..dae98b2261e 100644
--- a/main/hostapd/APKBUILD
+++ b/main/hostapd/APKBUILD
@@ -105,7 +105,7 @@ package() {
sha512sums="
243baa82d621f859d2507d8d5beb0ebda15a75548a62451dc9bca42717dcc8607adac49b354919a41d8257d16d07ac7268203a79750db0cfb34b51f80ff1ce8f hostapd-2.10.tar.gz
-2949e40061b15bbd0a1366afa5c48dbbfe699022842d4c13bb8f231894b292fb2f677cd853c157c7d298807d21092a3e441433ed81ee1951f94a26b563a92220 hostapd.initd
-0882263bbd7c0b05bf51f51d66e11a23a0b8ca7da2a3b8a30166d2c5f044c0c134e6bccb1d02c9e81819ca8fb0c0fb55c7121a08fe7233ccaa73ff8ab9a238fe hostapd.confd
+adeca34c6254ac6fccd84e6f08f8c394225e1b89e2c8771b46da5c85fe3fdabc568628530c39da3ab30b72e98891b07bbdb63f74217e79d6afb9796715d822f1 hostapd.initd
+250b072ae26892d5ba285d717d2742a29c12d52db59f021ff18a5eff709827f9987965539bf3f7b83c03fb8c103ea49604118a1d15056e6f1d8a7ae8043affbb hostapd.confd
7cde99c431f1cf746473ae53c3009735c2a718e7038c3bc1629fc45ca85a191d799e975960da96e3cf14a56389ba06eee78453a9dd457941d6af758b730cbd05 0001-hostapd-Add-the-missing-CONFIG_SAE-option-to-the-def.patch
"
diff --git a/main/hostapd/hostapd.confd b/main/hostapd/hostapd.confd
index 60381153aa6..6c01a071c45 100644
--- a/main/hostapd/hostapd.confd
+++ b/main/hostapd/hostapd.confd
@@ -1,5 +1,10 @@
-# Space separated list of configuration files
-CONFIGS="/etc/hostapd/hostapd.conf"
+# Configuration for /etc/init.d/hostapd
-# Extra options to pass to hostapd, see hostapd(8)
-OPTIONS=""
+# Path to the hostapd configuration file or multiple files separated by space.
+#cfgfile="/etc/hostapd/hostapd.conf"
+
+# Extra options to pass to hostapd, see hostapd(8).
+#command_args=""
+
+# Uncomment to run with process supervisor.
+# supervisor="supervise-daemon"
diff --git a/main/hostapd/hostapd.initd b/main/hostapd/hostapd.initd
index 522c5c8e16a..a7b603342de 100644
--- a/main/hostapd/hostapd.initd
+++ b/main/hostapd/hostapd.initd
@@ -1,39 +1,30 @@
#!/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="${OPTIONS} ${CONFIGS}"
-command_background=true
+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_pre() {
- checkconfig
-}
-
reload() {
- checkconfig || return 1
+ ebegin "Reloading $name configuration"
- ebegin "Reloading ${SVCNAME} configuration"
if [ "$supervisor" ]; then
$supervisor "$RC_SVCNAME" --signal HUP
else