Workaround to not parse entire file

This commit is contained in:
tux 2025-09-11 15:43:06 +02:00
parent ae7628e60f
commit e8c57ba19e

6
mon
View File

@ -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