From b9288efc4a8fe262a9ab9bf89a2784e7a877befe Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Tue, 14 Jan 2014 19:42:55 -0800 Subject: [PATCH] Allow specification of branch to install --- util/vm/install-mininet-vm.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/util/vm/install-mininet-vm.sh b/util/vm/install-mininet-vm.sh index aa93de4..3c82e75 100755 --- a/util/vm/install-mininet-vm.sh +++ b/util/vm/install-mininet-vm.sh @@ -3,6 +3,8 @@ # This script is intended to install Mininet into # a brand-new Ubuntu virtual machine, # to create a fully usable "tutorial" VM. +# +# optional argument: Mininet branch to install set -e echo `whoami` ALL=NOPASSWD: ALL | sudo tee -a /etc/sudoers > /dev/null sudo sed -i -e 's/Default/#Default/' /etc/sudoers @@ -25,11 +27,16 @@ fi if [ -e /etc/rc.local.backup ]; then sudo mv /etc/rc.local.backup /etc/rc.local fi -# Install Mininet +# Fetch Mininet sudo apt-get -y install git-core openssh-server git clone git://github.com/mininet/mininet -cd mininet -cd +# Optionally check out branch +if [ "$1" != "" ]; then + pushd mininet + git checkout -b $1 $1 + popd +fi +# Install Mininet time mininet/util/install.sh # Finalize VM time mininet/util/install.sh -tc @@ -38,4 +45,3 @@ time mininet/util/install.sh -tc # echo "export NOX_CORE_DIR=~/noxcore/build/src/" >> .bashrc #fi echo "Done preparing Mininet VM." -