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