From 70b044c51374205241aa8319a6377f8c1556e482 Mon Sep 17 00:00:00 2001 From: Carolina Fernandez Date: Fri, 17 Jan 2014 11:41:43 +0100 Subject: [PATCH] Improving 4fa2b07172edbd5ca1b369802494737efd71d689 --- install/flowvisor.sh | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/install/flowvisor.sh b/install/flowvisor.sh index 33bc0c1d..fe55458e 100644 --- a/install/flowvisor.sh +++ b/install/flowvisor.sh @@ -10,30 +10,46 @@ FLOWVISOR_RELEASE="1.4.0-1" -# 1. Obtain public key +# Obtain public repository key, install it, remove it wget http://updates.onlab.us/GPG-KEY-ONLAB - -# 2. Install the repository public key apt-key add GPG-KEY-ONLAB +rm GPG-KEY-ONLAB -# 3. Add the following line to /etc/apt/sources.list (if not already there) +# Add the following line to /etc/apt/sources.list (if not already there) if [ ! $(grep "deb http://updates.onlab.us/debian" /etc/apt/sources.list | grep -v "^#") ]; then - echo """# Release - the latest and greatest -deb http://updates.onlab.us/debian stable/ + echo """ +# +# FlowVisor at ON.LAB +# +## Release - the latest and greatest +deb http://updates.onlab.us/debian stable/ # Staging - what's coming next -deb http://updates.onlab.us/debian staging/ +deb http://updates.onlab.us/debian staging/ # Nightly - the bleeding edge -deb http://updates.onlab.us/debian unstable/""" >> /etc/apt/sources.list +deb http://updates.onlab.us/debian unstable/""" >> /etc/apt/sources.list fi -# 4. Update your apt database +# Update your apt database apt-get update -# 5. Install chosen version of FlowVisor +# Install sudo package to be able to run some FlowVisor commands +apt-get install sudo +# Install chosen version of FlowVisor apt-get install flowvisor=$FLOWVISOR_RELEASE -# 6. Modify to meet our requirements +# Generate new configuration and load it +if [ ! -f /etc/flowvisor/config.json ]; then + fvconfig generate /etc/flowvisor/config.json +fi +fvconfig load /etc/flowvisor/config.json + +# Modify to meet our requirements # Correct permissions in order to be able to pass this point and write to the DB +chown flowvisor:flowvisor /usr/share/db/flowvisor -R +chown flowvisor:flowvisor /etc/flowvisor -R chmod 755 /usr/share/db/flowvisor/derby.log # Modify log configuration to avoid writing on stdout -sed -i -e "s/log4j.rootCategory=WARN, system/#log4j.rootCategory=WARN, system\nlog4j.rootCategory=WARN/" /etc/flowvisor/fvlog.config +sed -i -e "s/^log4j.rootCategory=WARN, system/#log4j.rootCategory=WARN, system\nlog4j.rootCategory=WARN/" /etc/flowvisor/fvlog.config + +# Start FlowVisor +/etc/init.d/flowvisor restart