blob: 87666ba6ca6113357b2033f89bb1ba246ff24437 [file] [log] [blame]
#!/bin/bash
export USER=distributed
export USER_HOME=/home/${USER}
echo "Creating distributed tutorial"
IDEA_URL=http://download.jetbrains.com/idea/ideaIC-14.0.2.tar.gz
cd ~
git clone https://github.com/bocon13/onos-byon.git
# Pull ONOS code into local repo to compile against
mkdir -p .m2/repository/org
cp -r /home/mininet/.m2/repository/org/onosproject .m2/repository/org
sed -i -e 's/open/xdg-open/' ~/onos/tools/test/bin/onos-gui
echo "export KARAF_TAR=/home/mininet/apache-karaf-3.0.2.tar.gz" >> ~/.bashrc
echo "cell 3node > /dev/null" >> ~/.bashrc
cat > ~/startmn.sh << EOF
#!/bin/bash
sudo python ~/onos/tools/test/topos/sol.py \$OC1 \$OC2 \$OC3
EOF
chmod +x ~/startmn.sh
DESKTOP=${USER_HOME}/Desktop
mkdir -p ${DESKTOP}
cat > ${DESKTOP}/IntelliJ << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=IntelliJ
Name[en_US]=IntelliJ
Icon=/home/distributed/Applications/idea/bin/idea.png
Exec=/home/distributed/Applications/idea/bin/idea.sh
Comment[en_US]=
EOF
cat > ${DESKTOP}/Tutorial << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=ONOS Tutorial
Name[en_US]=ONOS Tutorial
Icon=internet-web-browser
Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/Distributed+ONOS+Tutorial
Comment[en_US]=
EOF
cat > ${DESKTOP}/Wireshark << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Wireshark
Name[en_US]=Wireshark
Icon=wireshark
Exec=/usr/bin/wireshark
Comment[en_US]=
EOF
cat > ${DESKTOP}/Terminal << EOF
[Desktop Entry]
Encoding=UTF-8
Name=LXTerminal
TryExec=lxterminal
Exec=lxterminal
Icon=lxterminal
Type=Application
Categories=GTK;Utility;TerminalEmulator;
EOF
cat > ${DESKTOP}/Reset << EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Reset
Name[en_US]=Reset
Icon=konsole
Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e '/bin/bash -c /home/mininet/reset-to-3.sh'
Comment[en_US]=
EOF
sudo apt-get install -y git-review
# Install IntelliJ
mkdir ~/Applications
cd ~/Applications
wget -c -N -O /tmp/idea.tar.gz ${IDEA_URL}
tar xzf /tmp/idea.tar.gz
sudo mv idea-IC-139.659.2 idea
cd -