aboutsummaryrefslogtreecommitdiff
path: root/docker/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh
blob: c39d64ff7ae9003619981d9951f65c16cbd9d68a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

bridge=$1
port=$2

ovs-vsctl br-exists $bridge; rc=$?
if [[ $rc == 2 ]]; then
    changed=changed
    ovs-vsctl add-br $bridge
fi

if [[ ! $(ovs-vsctl list-ports $bridge) =~ $(echo "\<$port\>") ]]; then
    changed=changed
    ovs-vsctl add-port $bridge $port
fi

echo $changed