blob: 697b90bd092f0b23d0ca0ce73b460e1179cc3c2e [file] [log] [blame]
Jonathan Hart59c036f2015-04-01 16:33:33 -07001#!/bin/bash
Jonathan Hart445aa5c2015-04-02 16:34:22 -07002# opt-setup.sh
Jonathan Harta509f472015-04-02 16:19:47 -07003#
4# Runs as optical user.
5#
6# Sets up the packet-optical tutorial.
Jonathan Hart59c036f2015-04-01 16:33:33 -07007
8export USER=optical
9export USER_HOME=/home/${USER}
10
11echo "Creating optical tutorial"
12
13DESKTOP=${USER_HOME}/Desktop
14
15mkdir -p ${DESKTOP}
16
17cat > ${DESKTOP}/ONOS << EOF
18[Desktop Entry]
19Encoding=UTF-8
20Type=Application
21Name=ONOS
22Name[en_US]=ONOS
23Icon=konsole
24Exec=/usr/bin/lxterminal -t 'ONOS' -e '/home/mininet/apache-karaf-3.0.2/bin/client -u karaf -h 10.0.3.11'
25Comment[en_US]=
26EOF
27
Jonathan Hartf16c1222015-04-01 19:38:49 -070028
Jonathan Hart59c036f2015-04-01 16:33:33 -070029cat > "${DESKTOP}/Mininet Small" << EOF
30[Desktop Entry]
31Encoding=UTF-8
32Type=Application
33Name=Mininet Small
34Name[en_US]=Mininet Small
35Icon=konsole
Jonathan Hartf16c1222015-04-01 19:38:49 -070036Exec=/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"'
Jonathan Hart59c036f2015-04-01 16:33:33 -070037Comment[en_US]=
38EOF
39
40cat > "${DESKTOP}/Mininet Large" << EOF
41[Desktop Entry]
42Encoding=UTF-8
43Type=Application
44Name=Mininet Large
45Name[en_US]=Mininet Large
46Icon=konsole
Jonathan Hartf16c1222015-04-01 19:38:49 -070047Exec=/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"'
Jonathan Hart59c036f2015-04-01 16:33:33 -070048Comment[en_US]=
49EOF
50
51cat > "${DESKTOP}/LINC-OE" << EOF
52[Desktop Entry]
53Encoding=UTF-8
54Type=Application
55Name=LINC-OE
56Name[en_US]=LINC-OE
57Icon=konsole
58Exec=/usr/bin/lxterminal -t 'LINC-OE' -e 'sudo linc-oe/rel/linc/bin/linc attach'
59Comment[en_US]=
60EOF
61
62cat > ${DESKTOP}/Tutorial << EOF
63[Desktop Entry]
64Encoding=UTF-8
65Type=Application
66Name=Tutorial
67Name[en_US]=Tutorial
68Icon=internet-web-browser
69Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/Packet+Optical+Tutorial
70Comment[en_US]=
71EOF
72
73cat > ${DESKTOP}/GUI << EOF
74[Desktop Entry]
75Encoding=UTF-8
76Type=Application
77Name=ONOS GUI
78Name[en_US]=ONOS GUI
79Icon=internet-web-browser
80Exec=/usr/bin/chromium-browser http://10.0.3.11:8181/onos/ui/index.html#topo
81Comment[en_US]=
82EOF
83
84cat > ${DESKTOP}/Wireshark << EOF
85[Desktop Entry]
86Encoding=UTF-8
87Type=Application
88Name=Wireshark
89Name[en_US]=Wireshark
90Icon=wireshark
91Exec=/usr/bin/wireshark
92Comment[en_US]=
93EOF
94
95
Jonathan Hartf31c4b52015-04-02 15:07:28 -070096cat > ${DESKTOP}/Reset << EOF
Jonathan Hart59c036f2015-04-01 16:33:33 -070097[Desktop Entry]
98Encoding=UTF-8
99Type=Application
100Name=Reset ONOS
101Name[en_US]=Reset ONOS
102Icon=konsole
Jonathan Hart5cf990e2015-04-02 14:47:36 -0700103Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e '/bin/bash -c "/home/mininet/reset-to-1.sh onos-app-proxyarp,onos-app-optical"'
Jonathan Hart59c036f2015-04-01 16:33:33 -0700104Comment[en_US]=
105EOF
106
107
Jonathan Hartf16c1222015-04-01 19:38:49 -0700108ln -s /home/mininet/onos onos
109ln -s /home/mininet/.m2 .m2
110
Jonathan Hart59c036f2015-04-01 16:33:33 -0700111# -------------- Setup LINC & dependencies ---------------
112git clone https://github.com/FlowForwarding/LINC-config-generator.git
113cd ~/LINC-config-generator
Jonathan Hart5cf990e2015-04-02 14:47:36 -0700114cp priv/* .
Jonathan Hart59c036f2015-04-01 16:33:33 -0700115make
116cd
117
118git clone https://github.com/FlowForwarding/LINC-Switch.git linc-oe
119cd linc-oe
120sed -i s/3000/300000/ rel/files/vm.args
121cp rel/files/sys.config.orig rel/files/sys.config
Jonathan Hart5cf990e2015-04-02 14:47:36 -0700122make
Jonathan Hart59c036f2015-04-01 16:33:33 -0700123cd