Skip to content

Instantly share code, notes, and snippets.

@DavidWittman
Last active December 24, 2015 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidWittman/6739887 to your computer and use it in GitHub Desktop.
Save DavidWittman/6739887 to your computer and use it in GitHub Desktop.
Upstart job to automatically bring up OVS bridges at boot time
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