blob: 697b90bd092f0b23d0ca0ce73b460e1179cc3c2e [file] [log] [blame]
#!/bin/bash
# opt-setup.sh
#
# Runs as optical user.
#
# Sets up the packet-optical tutorial.
export USER=optical
export USER_HOME=/home/${USER}
echo "Creating optical tutorial"
DESKTOP=${USER_HOME}/Desktop
mkdir -p ${DESKTOP}
cat > ${DESKTOP}/ONOS << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=ONOS
Name[en_US]=ONOS
Icon=konsole
Exec=/usr/bin/lxterminal -t 'ONOS' -e '/home/mininet/apache-karaf-3.0.2/bin/client -u karaf -h 10.0.3.11'
Comment[en_US]=
EOF
cat > "${DESKTOP}/Mininet Small" << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Mininet Small
Name[en_US]=Mininet Small
Icon=konsole
Exec=/usr/bin/lxterminal -t 'Mininet Small Topology' -e '/bin/bash -c "export ONOS_ROOT=~/onos ; sudo -E python /home/mininet/onos/tools/test/topos/opticalTest.py 10.0.3.11"'
Comment[en_US]=
EOF
cat > "${DESKTOP}/Mininet Large" << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Mininet Large
Name[en_US]=Mininet Large
Icon=konsole
Exec=/usr/bin/lxterminal -t 'Mininet Large Topology' -e '/bin/bash -c "export ONOS_ROOT=~/onos ; sudo -E python /home/mininet/onos/tools/test/topos/opticalTestBig.py 10.0.3.11"'
Comment[en_US]=
EOF
cat > "${DESKTOP}/LINC-OE" << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=LINC-OE
Name[en_US]=LINC-OE
Icon=konsole
Exec=/usr/bin/lxterminal -t 'LINC-OE' -e 'sudo linc-oe/rel/linc/bin/linc attach'
Comment[en_US]=
EOF
cat > ${DESKTOP}/Tutorial << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Tutorial
Name[en_US]=Tutorial
Icon=internet-web-browser
Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/Packet+Optical+Tutorial
Comment[en_US]=
EOF
cat > ${DESKTOP}/GUI << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=ONOS GUI
Name[en_US]=ONOS GUI
Icon=internet-web-browser
Exec=/usr/bin/chromium-browser http://10.0.3.11:8181/onos/ui/index.html#topo
Comment[en_US]=
EOF
cat > ${DESKTOP}/Wireshark << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Wireshark
Name[en_US]=Wireshark
Icon=wireshark
Exec=/usr/bin/wireshark
Comment[en_US]=
EOF
cat > ${DESKTOP}/Reset << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Reset ONOS
Name[en_US]=Reset ONOS
Icon=konsole
Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e '/bin/bash -c "/home/mininet/reset-to-1.sh onos-app-proxyarp,onos-app-optical"'
Comment[en_US]=
EOF
ln -s /home/mininet/onos onos
ln -s /home/mininet/.m2 .m2
# -------------- Setup LINC & dependencies ---------------
git clone https://github.com/FlowForwarding/LINC-config-generator.git
cd ~/LINC-config-generator
cp priv/* .
make
cd
git clone https://github.com/FlowForwarding/LINC-Switch.git linc-oe
cd linc-oe
sed -i s/3000/300000/ rel/files/vm.args
cp rel/files/sys.config.orig rel/files/sys.config
make
cd