diff --git a/files/qemu-ifdown b/files/qemu-ifdown index 6be47b0..beca916 100755 --- a/files/qemu-ifdown +++ b/files/qemu-ifdown @@ -23,9 +23,9 @@ if [ ! -z $BRIDGE ]; then BRIDGE=${BRIDGE##*/} echo "removing $IFACE from $BRIDGE" brctl delif $BRIDGE $IFACE - if ! ls /sys/devices/virtual/net/$BRIDGE/brif/ | grep -qv "vxlan\|vlan"; then #if so is the *local* bridge now empty? if so, nuke the whole bridge including tunnel endpoint + if ! ls /sys/devices/virtual/net/$BRIDGE/brif/ | grep -qv "vxlan\|vlan" 2>/dev/null; then #if so is the *local* bridge now empty? if so, nuke the whole bridge including tunnel endpoint echo "removing unused bridge: $BRIDGE" - for uplinkif in ls /sys/devices/virtual/net/$BRIDGE/brif/; do + for uplinkif in $(ls /sys/devices/virtual/net/$BRIDGE/brif/ 2>/dev/null); do ip link del dev $uplinkif done ip link set down $BRIDGE