blob: 89f02c6fa12c1b169665211c0d8e5034886d191b [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
Luca Prete706dbc52016-08-16 11:57:41 -070030cat > ~/startmn.sh << EOF
31#!/bin/bash
32sudo python ~/onos/tools/test/topos/sol.py \$OC1 \$OC2 \$OC3
33EOF
34
35chmod +x ~/startmn.sh
36
37DESKTOP=${USER_HOME}/Desktop
38
39mkdir -p ${DESKTOP}
40
41cat > ${DESKTOP}/IntelliJ << EOF
42[Desktop Entry]
43Encoding=UTF-8
44Type=Application
45Name=IntelliJ
46Name[en_US]=IntelliJ
47Icon=/home/distributed/Applications/idea/bin/idea.png
48Exec=/home/distributed/Applications/idea/bin/idea.sh
49Comment[en_US]=
50EOF
51
52cat > ${DESKTOP}/Tutorial << EOF
53[Desktop Entry]
54Encoding=UTF-8
55Type=Application
56Name=ONOS Tutorial
57Name[en_US]=ONOS Tutorial
58Icon=internet-web-browser
59Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/Distributed+ONOS+Tutorial
60Comment[en_US]=
61EOF
62
63
64cat > ${DESKTOP}/Wireshark << EOF
65[Desktop Entry]
66Encoding=UTF-8
67Type=Application
68Name=Wireshark
69Name[en_US]=Wireshark
70Icon=wireshark
71Exec=/usr/bin/wireshark
72Comment[en_US]=
73EOF
74
75cat > ${DESKTOP}/Terminal << EOF
76[Desktop Entry]
77Encoding=UTF-8
78Name=LXTerminal
79TryExec=lxterminal
80Exec=lxterminal
81Icon=lxterminal
82Type=Application
83Categories=GTK;Utility;TerminalEmulator;
84EOF
85
86cat > ${DESKTOP}/Reset << EOF
87[Desktop Entry]
88Encoding=UTF-8
89Type=Application
90Name=Reset
91Name[en_US]=Reset
92Icon=konsole
93Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e '/bin/bash -c /home/mininet/reset-to-3.sh'
94Comment[en_US]=
95EOF
96
97sudo apt-get install -y git-review
98
99# Install IntelliJ
100mkdir ~/Applications
101cd ~/Applications
102
103wget -c -N -O /tmp/idea.tar.gz ${IDEA_URL}
104tar xzf /tmp/idea.tar.gz
Luca Prete32a1fdb2016-08-16 15:00:41 -0700105sudo mv idea-IC-162.1628.40 idea
Luca Prete706dbc52016-08-16 11:57:41 -0700106
107cd -