proper iface handling
This commit is contained in:
parent
2b06e8fc7c
commit
06e9460aab
14
wpe
14
wpe
@ -40,13 +40,19 @@ while true; do
|
||||
done
|
||||
|
||||
echo "[+] Preparing $iface for hostapd-wpe..."
|
||||
if ! nmcli device set "$iface" managed no; then
|
||||
echo "[!] Failed to set $iface unmanaged. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
nmcli device set "$iface" managed no
|
||||
ip link set "$iface" down
|
||||
ip link set "$iface" up
|
||||
|
||||
# Check for hostapd-wpe.conf in the current directory
|
||||
if [[ -f "hostapd-wpe.conf" ]]; then
|
||||
if grep -q '^interface=' hostapd-wpe.conf; then
|
||||
sed -i "s/^interface=.*/interface=$iface/" hostapd-wpe.conf
|
||||
echo "[+] Updated existing interface definition in hostapd-wpe.conf."
|
||||
else
|
||||
echo "interface=$iface" >> hostapd-wpe.conf
|
||||
echo "[+] Added missing interface definition to hostapd-wpe.conf."
|
||||
fi
|
||||
echo "[+] Found hostapd-wpe.conf in the current directory. Using it."
|
||||
config_file="hostapd-wpe.conf"
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user