openvswitch bridge script

Whenever the linux bridge comes back into play, such as when I upgraded libvirt to 1.0.0, I just run this script. I am sure there are easier ways, but this works fine for me for now.

#!/bin/bash
#
# start with a lsmod grep bridge to show the linux bridge is there
#
lsmod | grep bridge > /dev/null
if [ “$?” -eq 0 ]; then
echo “there is a linux bridge”
echo ” do you want to delete it? If so hit enter ”
read -p “Press [Enter] key to continue…”
rmmod bridge
if [ “$?” -eq 0 ]; then
lsmod | grep bridge > /dev/null
if [ “$?” -eq 0 ]; then
echo “there is a linux bridge”
else
echo “there is no linux bridge”
fi
fi
else
echo “there is no linux bridge”
fi
#
# next do a lsmod grep bridge to shwo the linux bridge is there
#
module-assistant auto-install openvswitch-datapath
#
echo “now we start openvswitch”
service openvswitch-switch start
#
echo “now we status openvswitch”
service openvswitch-switch status
#
lsmod | grep brcom >> /dev/null
if [ “$?” -eq 0 ]; then
echo “there is a brcom bridge”
fi
#
ovs-vsctl show

Advertisements

About johnnychipotle

cloud blogger
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s