From 0f5e05c088f9dd6ffbdbfeb19d6f7c9751962508 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Tue, 12 Jan 2016 01:00:34 -0800 Subject: [PATCH] Handle openvswitch-testcontroller in ubuntu 15 --- util/install.sh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/util/install.sh b/util/install.sh index e764656..71d5ca8 100755 --- a/util/install.sh +++ b/util/install.sh @@ -357,23 +357,28 @@ function ovs { fi $install openvswitch-switch + OVSC="" if $install openvswitch-controller; then - # Switch can run on its own, but - # Mininet should control the controller - # This appears to only be an issue on Ubuntu/Debian - if sudo service openvswitch-controller stop; then - echo "Stopped running controller" - fi - if [ -e /etc/init.d/openvswitch-controller ]; then - sudo update-rc.d openvswitch-controller disable - fi + OVSC="openvswitch-controller" else echo "Attempting to install openvswitch-testcontroller" - if ! $install openvswitch-testcontroller; then + if $install openvswitch-testcontroller; then + OVSC="openvswitch-testcontroller" + else echo "Failed - skipping openvswitch-testcontroller" fi fi - + if [ "$OVSC" ]; then + # Switch can run on its own, but + # Mininet should control the controller + # This appears to only be an issue on Ubuntu/Debian + if sudo service $OVSC stop; then + echo "Stopped running controller" + fi + if [ -e /etc/init.d/$OVSC ]; then + sudo update-rc.d $OVSC disable + fi + fi } function remove_ovs {