Jonathan Hart | 2af01a0 | 2014-12-01 21:38:50 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # vm-setup.sh |
| 3 | # |
| 4 | # This script installs ONOS dependencies and installs a desktop environment on a Miniet VM. |
| 5 | |
| 6 | |
| 7 | export CURRENT_USER=sdnip |
| 8 | export USER_HOME=/home/${CURRENT_USER} |
| 9 | |
Jonathan Hart | 2af01a0 | 2014-12-01 21:38:50 -0800 | [diff] [blame] | 10 | # -------------- Setup keys ------------------- |
| 11 | |
| 12 | mkdir -p ~/.ssh |
| 13 | ssh-keygen -t dsa -P "" -f .ssh/id_dsa |
| 14 | cp .ssh/id_dsa.pub .ssh/authorized_keys |
| 15 | |
| 16 | # -------------- Setup Desktop --------------- |
| 17 | |
| 18 | DESKTOP=${USER_HOME}/Desktop |
| 19 | |
| 20 | mkdir -p ${DESKTOP} |
| 21 | |
| 22 | cat > ${DESKTOP}/ONOS << EOF |
| 23 | [Desktop Entry] |
| 24 | Encoding=UTF-8 |
| 25 | Type=Application |
| 26 | Name=ONOS |
| 27 | Name[en_US]=ONOS |
| 28 | Icon=konsole |
| 29 | Exec=/usr/bin/lxterminal -e '/opt/onos/apache-karaf-3.0.2/bin/client -u karaf' |
| 30 | Comment[en_US]= |
| 31 | EOF |
| 32 | |
Jonathan Hart | eb3f054 | 2014-12-02 16:27:40 -0800 | [diff] [blame] | 33 | cat > "${DESKTOP}/SDN-IP Mininet" << EOF |
Jonathan Hart | 2af01a0 | 2014-12-01 21:38:50 -0800 | [diff] [blame] | 34 | [Desktop Entry] |
| 35 | Encoding=UTF-8 |
| 36 | Type=Application |
Jonathan Hart | eb3f054 | 2014-12-02 16:27:40 -0800 | [diff] [blame] | 37 | Name=SDN-IP Mininet |
| 38 | Name[en_US]=SDN-IP Mininet |
Jonathan Hart | 2af01a0 | 2014-12-01 21:38:50 -0800 | [diff] [blame] | 39 | Icon=konsole |
Jonathan Hart | cc03dc7 | 2014-12-02 00:08:54 -0800 | [diff] [blame] | 40 | Exec=/usr/bin/lxterminal -e 'sudo mn --custom /home/sdnip/sdnip/tutorial.py --topo sdnip --controller remote --nolistenport' |
Jonathan Hart | 2af01a0 | 2014-12-01 21:38:50 -0800 | [diff] [blame] | 41 | Comment[en_US]= |
| 42 | EOF |
| 43 | |
| 44 | cat > ${DESKTOP}/Tutorial << EOF |
| 45 | [Desktop Entry] |
| 46 | Encoding=UTF-8 |
| 47 | Type=Application |
| 48 | Name=SDN-IP Tutorial |
| 49 | Name[en_US]=SDN-IP Tutorial |
| 50 | Icon=internet-web-browser |
| 51 | Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/SDN-IP+Tutorial |
| 52 | Comment[en_US]= |
| 53 | EOF |
| 54 | |
| 55 | cat > ${DESKTOP}/GUI << EOF |
| 56 | [Desktop Entry] |
| 57 | Encoding=UTF-8 |
| 58 | Type=Application |
| 59 | Name=ONOS GUI |
| 60 | Name[en_US]=ONOS GUI |
| 61 | Icon=internet-web-browser |
| 62 | Exec=/usr/bin/chromium-browser http://localhost:8181/onos/ui/index.html#topo |
| 63 | Comment[en_US]= |
| 64 | EOF |
| 65 | |
| 66 | cat > ${DESKTOP}/Wireshark << EOF |
| 67 | [Desktop Entry] |
| 68 | Encoding=UTF-8 |
| 69 | Type=Application |
| 70 | Name=Wireshark |
| 71 | Name[en_US]=Wireshark |
| 72 | Icon=wireshark |
| 73 | Exec=/usr/bin/wireshark |
| 74 | Comment[en_US]= |
| 75 | EOF |
| 76 | |
| 77 | cat > ${DESKTOP}/Reset << EOF |
| 78 | [Desktop Entry] |
| 79 | Encoding=UTF-8 |
| 80 | Type=Application |
| 81 | Name=Reset |
| 82 | Name[en_US]=Reset |
| 83 | Icon=konsole |
| 84 | Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e 'sudo service onos restart' |
| 85 | Comment[en_US]= |
| 86 | EOF |
Jonathan Hart | 60d3156 | 2014-12-01 21:48:08 -0800 | [diff] [blame] | 87 | |
Marc De Leenheer | b75cb13 | 2015-01-16 10:06:02 -0800 | [diff] [blame] | 88 | |
| 89 | echo "sudo service onos start > /dev/null 2>&1" >> ~/.profile |