blob: 9cd431ad3868c85472f78557978feec9f9f16be2 [file] [log] [blame]
Luca Prete8137ffc2016-08-16 11:53:45 -07001#!/bin/bash
2# opt-setup.sh
3#
4# Runs as optical user.
5#
6# Sets up the packet-optical tutorial.
7
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.5/bin/client -u karaf -h 10.0.3.11'
25Comment[en_US]=
26EOF
27
28
29cat > "${DESKTOP}/Mininet Small" << EOF
30[Desktop Entry]
31Encoding=UTF-8
32Type=Application
33Name=Mininet Small
34Name[en_US]=Mininet Small
35Icon=konsole
36Exec=/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"'
37Comment[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
47Exec=/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"'
48Comment[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
96cat > ${DESKTOP}/Reset << EOF
97[Desktop Entry]
98Encoding=UTF-8
99Type=Application
100Name=Reset ONOS
101Name[en_US]=Reset ONOS
102Icon=konsole
103Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e '/bin/bash -c "/home/mininet/reset-to-1.sh proxyarp,optical"'
104Comment[en_US]=
105EOF
106
107
108ln -s /home/mininet/onos onos
109ln -s /home/mininet/.m2 .m2
110
111# -------------- Setup LINC & dependencies ---------------
112git clone https://github.com/FlowForwarding/LINC-config-generator.git
113cd ~/LINC-config-generator
114cp priv/* .
115make
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
122make
123cd