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