Last active
December 24, 2015 03:49
-
-
Save DavidWittman/6739887 to your computer and use it in GitHub Desktop.
Upstart job to automatically bring up OVS bridges at boot time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "Quantum Open vSwitch bridge ifup" | |
author "David Wittman <david.wittman@rackspace.com>" | |
start on started quantum-plugin-openvswitch-agent | |
console log | |
# Use post-start script instead of script so it only runs once | |
post-start script | |
SLEEP=10 | |
echo "Started on $(date)" | |
echo "Sleeping for ${SLEEP} seconds while OVS starts" | |
sleep $SLEEP | |
NETWORK_CONFIG_FILE="/etc/network/interfaces" | |
for BRIDGE in $(ovs-vsctl list-br); do | |
if grep -w "$BRIDGE" $NETWORK_CONFIG_FILE > /dev/null; then | |
echo "Bringing up OVS bridge ${BRIDGE}" | |
ifup $BRIDGE | |
fi | |
done | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment