blob: 747ceee2254fa2002e36dc34fb1a7f01234efabe [file] [log] [blame]
Jonathan Hart59c036f2015-04-01 16:33:33 -07001#!/bin/bash
Jonathan Hart445aa5c2015-04-02 16:34:22 -07002# dist-setup.sh
Jonathan Harta509f472015-04-02 16:19:47 -07003#
4# Runs as distributed user.
5#
6# Sets up the distributed ONOS tutorial.
Jonathan Hart59c036f2015-04-01 16:33:33 -07007
8export USER=distributed
9export USER_HOME=/home/${USER}
10
11echo "Creating distributed tutorial"
12
13IDEA_URL=http://download.jetbrains.com/idea/ideaIC-14.0.2.tar.gz
14
15cd ~
16
17git clone https://github.com/bocon13/onos-byon.git
18
Jonathan Hart5cf990e2015-04-02 14:47:36 -070019# Pull ONOS code into local repo to compile against
20mkdir -p .m2/repository/org
21cp -r /home/mininet/.m2/repository/org/onosproject .m2/repository/org
22
Jonathan Hart59c036f2015-04-01 16:33:33 -070023sed -i -e 's/open/xdg-open/' ~/onos/tools/test/bin/onos-gui
24
Jonathan Hartf648acd2015-07-07 03:16:47 -070025echo "export KARAF_TAR=/home/mininet/apache-karaf-3.0.3.tar.gz" >> ~/.bashrc
Jonathan Hart5cf990e2015-04-02 14:47:36 -070026echo "cell 3node > /dev/null" >> ~/.bashrc
27
28
Jonathan Hart59c036f2015-04-01 16:33:33 -070029cat > ~/startmn.sh << EOF
30#!/bin/bash
31sudo python ~/onos/tools/test/topos/sol.py \$OC1 \$OC2 \$OC3
32EOF
33
34chmod +x ~/startmn.sh
35
36DESKTOP=${USER_HOME}/Desktop
37
38mkdir -p ${DESKTOP}
39
40cat > ${DESKTOP}/IntelliJ << EOF
41[Desktop Entry]
42Encoding=UTF-8
43Type=Application
44Name=IntelliJ
45Name[en_US]=IntelliJ
46Icon=/home/distributed/Applications/idea/bin/idea.png
47Exec=/home/distributed/Applications/idea/bin/idea.sh
48Comment[en_US]=
49EOF
50
51cat > ${DESKTOP}/Tutorial << EOF
52[Desktop Entry]
53Encoding=UTF-8
54Type=Application
55Name=ONOS Tutorial
56Name[en_US]=ONOS Tutorial
57Icon=internet-web-browser
58Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/Distributed+ONOS+Tutorial
59Comment[en_US]=
60EOF
61
62
63cat > ${DESKTOP}/Wireshark << EOF
64[Desktop Entry]
65Encoding=UTF-8
66Type=Application
67Name=Wireshark
68Name[en_US]=Wireshark
69Icon=wireshark
70Exec=/usr/bin/wireshark
71Comment[en_US]=
72EOF
73
74cat > ${DESKTOP}/Terminal << EOF
75[Desktop Entry]
76Encoding=UTF-8
77Name=LXTerminal
78TryExec=lxterminal
79Exec=lxterminal
80Icon=lxterminal
81Type=Application
82Categories=GTK;Utility;TerminalEmulator;
83EOF
84
Jonathan Hart5cf990e2015-04-02 14:47:36 -070085cat > ${DESKTOP}/Reset << EOF
86[Desktop Entry]
87Encoding=UTF-8
88Type=Application
89Name=Reset
90Name[en_US]=Reset
91Icon=konsole
92Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e '/bin/bash -c /home/mininet/reset-to-3.sh'
93Comment[en_US]=
94EOF
95
Jonathan Hart59c036f2015-04-01 16:33:33 -070096sudo apt-get install -y git-review
97
98# Install IntelliJ
99mkdir ~/Applications
100cd ~/Applications
101
102wget -c -N -O /tmp/idea.tar.gz ${IDEA_URL}
103tar xzf /tmp/idea.tar.gz
104sudo mv idea-IC-139.659.2 idea
105
106cd -