From e8c57ba19e21d47cf4120d86fb7b1c4c17126724 Mon Sep 17 00:00:00 2001 From: tux Date: Thu, 11 Sep 2025 15:43:06 +0200 Subject: [PATCH] Workaround to not parse entire file --- mon | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mon b/mon index 1b2a47b..7ea9b7a 100755 --- a/mon +++ b/mon @@ -85,10 +85,12 @@ ip link set "$iface" up # For monitoring only used for using the same channel as the ap if [[ -f "hostapd-wpe.conf" ]]; then echo "[+] Found hostapd-wpe.conf in the current directory. Using it." - source hostapd-wpe.conf + # Import channel variable only + source <(grep -E '^[[:space:]]*channel[[:space:]]*=' hostapd-wpe.conf + else echo "[!] hostapd-wpe.conf not found in the current directory. Using the default: /etc/hostapd-wpe/hostapd-wpe.conf" - source /etc/hostapd-wpe/hostapd-wpe.conf + source <(grep -E '^[[:space:]]*channel[[:space:]]*=' /etc/hostapd-wpe/hostapd-wpe.conf fi # Start monitoring