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 | |
| 10 | #--------------- Copy SDNIP code to home ----- |
| 11 | |
| 12 | cp -r /home/tutorial1/onos-next/tools/test/topos/sdnip ${USER_HOME}/ |
| 13 | cp -r ${USER_HOME}/sdnip/configs ${USER_HOME}/ |
| 14 | |
| 15 | # -------------- Setup keys ------------------- |
| 16 | |
| 17 | mkdir -p ~/.ssh |
| 18 | ssh-keygen -t dsa -P "" -f .ssh/id_dsa |
| 19 | cp .ssh/id_dsa.pub .ssh/authorized_keys |
| 20 | |
| 21 | # -------------- Setup Desktop --------------- |
| 22 | |
| 23 | DESKTOP=${USER_HOME}/Desktop |
| 24 | |
| 25 | mkdir -p ${DESKTOP} |
| 26 | |
| 27 | cat > ${DESKTOP}/ONOS << EOF |
| 28 | [Desktop Entry] |
| 29 | Encoding=UTF-8 |
| 30 | Type=Application |
| 31 | Name=ONOS |
| 32 | Name[en_US]=ONOS |
| 33 | Icon=konsole |
| 34 | Exec=/usr/bin/lxterminal -e '/opt/onos/apache-karaf-3.0.2/bin/client -u karaf' |
| 35 | Comment[en_US]= |
| 36 | EOF |
| 37 | |
| 38 | cat > ${DESKTOP}/Mininet << EOF |
| 39 | [Desktop Entry] |
| 40 | Encoding=UTF-8 |
| 41 | Type=Application |
| 42 | Name=Mininet |
| 43 | Name[en_US]=Mininet |
| 44 | Icon=konsole |
| 45 | Exec=/usr/bin/lxterminal -e 'sudo mn --custom /home/sdnip/tutorial.py --topo sdnip --controller remote --nolistenport' |
| 46 | Comment[en_US]= |
| 47 | EOF |
| 48 | |
| 49 | cat > ${DESKTOP}/Tutorial << EOF |
| 50 | [Desktop Entry] |
| 51 | Encoding=UTF-8 |
| 52 | Type=Application |
| 53 | Name=SDN-IP Tutorial |
| 54 | Name[en_US]=SDN-IP Tutorial |
| 55 | Icon=internet-web-browser |
| 56 | Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/SDN-IP+Tutorial |
| 57 | Comment[en_US]= |
| 58 | EOF |
| 59 | |
| 60 | cat > ${DESKTOP}/GUI << EOF |
| 61 | [Desktop Entry] |
| 62 | Encoding=UTF-8 |
| 63 | Type=Application |
| 64 | Name=ONOS GUI |
| 65 | Name[en_US]=ONOS GUI |
| 66 | Icon=internet-web-browser |
| 67 | Exec=/usr/bin/chromium-browser http://localhost:8181/onos/ui/index.html#topo |
| 68 | Comment[en_US]= |
| 69 | EOF |
| 70 | |
| 71 | cat > ${DESKTOP}/Wireshark << EOF |
| 72 | [Desktop Entry] |
| 73 | Encoding=UTF-8 |
| 74 | Type=Application |
| 75 | Name=Wireshark |
| 76 | Name[en_US]=Wireshark |
| 77 | Icon=wireshark |
| 78 | Exec=/usr/bin/wireshark |
| 79 | Comment[en_US]= |
| 80 | EOF |
| 81 | |
| 82 | cat > ${DESKTOP}/Reset << EOF |
| 83 | [Desktop Entry] |
| 84 | Encoding=UTF-8 |
| 85 | Type=Application |
| 86 | Name=Reset |
| 87 | Name[en_US]=Reset |
| 88 | Icon=konsole |
| 89 | Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e 'sudo service onos restart' |
| 90 | Comment[en_US]= |
| 91 | EOF |