Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 16 lines (11 sloc) 392 Bytes
#!/bin/bash
set -o errexit
set -o pipefail
# This script will remove stale veth* ports from OVS $BRIDGE
BRIDGE=br1
if [ "$1" = "all" ]; then
IFs=$(sudo ovs-vsctl show | grep -oP "(?<=[\s\"])veth[^[\s\"]*" | sort -u)
else
IFs=$(sudo ovs-vsctl show | grep "could not open" | grep -oP "(?<=\s)veth[^\s]*")
fi
for x in ${IFs} ; do echo $x ; sudo ovs-vsctl del-port $BRIDGE $x ; done