From fe2348a725246f3ed83e0f31a4330bfce5e2eb38 Mon Sep 17 00:00:00 2001 From: garywill Date: Wed, 18 Dec 2024 20:52:53 +0800 Subject: [PATCH] some aa-complain improve --- lnxrouter | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lnxrouter b/lnxrouter index 6665aa4..f55d6ec 100755 --- a/lnxrouter +++ b/lnxrouter @@ -2087,8 +2087,9 @@ run_wifi_ap_processes() { echo echo "Starting hostapd" - if COMPLAIN_CMD=$(command -v complain || command -v aa-complain); then - $COMPLAIN_CMD hostapd + if COMPLAIN_CMD="$(command -v aa-complain || command -v complain)"; then + echo "Setting hostapd to AppArmor complain mode..." + "$COMPLAIN_CMD" hostapd fi # hostapd '-P' works only when use '-B' (run in background) @@ -2108,10 +2109,9 @@ start_dnsmasq() { echo echo "Starting dnsmasq" - if COMPLAIN_CMD=$(command -v complain || command -v aa-complain); then - # openSUSE's apparmor does not allow dnsmasq to read files. - # remove restriction. - $COMPLAIN_CMD dnsmasq + if COMPLAIN_CMD="$(command -v aa-complain || command -v complain)"; then + echo "Setting dnsmasq to AppArmor complain mode..." + "$COMPLAIN_CMD" dnsmasq fi # Using '-d'(no daemon) dnsmasq will not turn into 'nobody'