summaryrefslogtreecommitdiffstats
path: root/roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2
blob: c04ce60cc596575043b7682c2504bc560452b9a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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