From c1db8d64093b8e4a681c3fc5a535762e9280586b Mon Sep 17 00:00:00 2001 From: Bill Zimmerman Date: Thu, 23 Jun 2022 17:06:58 +0200 Subject: [PATCH] Set DAEMON_CONF path for hostapd --- installers/common.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/installers/common.sh b/installers/common.sh index fc661394..6e89f307 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -649,6 +649,15 @@ function _patch_system_files() { _install_log "Unmasking and enabling hostapd service" sudo systemctl unmask hostapd.service sudo systemctl enable hostapd.service + + # Set correct DAEMON_CONF path for hostapd (Ubuntu20 + Armbian22) + if [ ${OS,,} = "ubuntu" ] && [[ ${RELEASE} =~ ^(20.04|19.10|18.04) ]]; then + conf="/etc/default/hostapd" + key="DAEMON_CONF" + value="/etc/hostapd/hostapd.conf" + echo "Setting default ${key} path to ${value}" + sudo sed -i "/^$key/ { s/^#//; s%=.*%=\"$value\"%; }" "$conf" || _install_status 1 "Unable to set value in ${conf}" + fi _install_status 0 }