diff options
Diffstat (limited to 'roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2')
-rwxr-xr-x | roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2 | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2 b/roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2 new file mode 100755 index 0000000..c04ce60 --- /dev/null +++ b/roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2 @@ -0,0 +1,18 @@ +#!/bin/bash + +ifaces=$(ovs-vsctl show | grep -oP "could not open network device\s*\Kveth[a-f0-9]+") +[ $? -eq 0 ] || exit + +#Find bridge +#ovs-vsctl list-br + +for iface in $ifaces; do +# echo "$iface" + +# Verify that interface is not active + ip link show | grep $iface &> /dev/null + [ $? -eq 0 ] && continue + + echo "Removing: $iface" + ovs-vsctl del-port br0 $iface +done |