From 97c67abab07a57840f95d04fadbd13b3c0f5b328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=81LI=20G=C3=A1bor=20J=C3=A1nos?= Date: Sat, 28 May 2022 12:44:37 +0200 Subject: Incorporate `hostapd`. The inclusion of `hostapd` [1] brings a lot of related changes because the build process have to extended to take the challenge. - Convert `wpa_passthru` to a more a generic services, called `uds_passthru` to deal with the control socket forwarding. It can also log the `socat` errors properly. - Make the `Makefile` more parametric therefore the virtual disk image can be customized better. - Default configurations are now moved fully to the guest's side. - Tweak the packages to be more flexible. - Document everything. [1] https://w1.fi/hostapd/ --- aports/hostapd/hostapd.initd | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 aports/hostapd/hostapd.initd (limited to 'aports/hostapd/hostapd.initd') diff --git a/aports/hostapd/hostapd.initd b/aports/hostapd/hostapd.initd new file mode 100644 index 0000000..7813fd1 --- /dev/null +++ b/aports/hostapd/hostapd.initd @@ -0,0 +1,46 @@ +#!/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 $ + +extra_started_commands="reload" + +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 ${SVCNAME} configuration" + kill -HUP $(pidof /usr/sbin/hostapd) > /dev/null 2>&1 + eend $? +} -- cgit v1.2.3