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 {