#!/bin/bash # Usage: ./remove_all_wireless.sh # Removes all interfaces on phy0 and phy1 echo "Removing all wireless interfaces on phy0 and phy1..." for PHY in phy0 phy1; do INTERFACES=$(iw dev | awk -v phy="${PHY//[!0-9]/}" ' $1 == "phy#"phy {getline; while ($1 == "Interface") {print $2; getline}}') for IFACE in $INTERFACES; do echo " - Deleting $IFACE on $PHY" ip link set "$IFACE" down 2>/dev/null iw dev "$IFACE" del done done echo "All wireless interfaces removed."