fuel-ccp-neutron/service/files/ovs-ensure-configured.sh

20 lines
333 B
Bash

#!/bin/bash
bridge=$1
port=$2
ip link set $port up
ovs-vsctl br-exists $bridge; rc=$?
if [[ $rc == 2 ]]; then
changed=changed
ovs-vsctl --no-wait add-br $bridge
fi
if [[ ! $(ovs-vsctl list-ports $bridge) =~ $(echo "\<$port\>") ]]; then
changed=changed
ovs-vsctl --no-wait add-port $bridge $port
fi
echo $changed