| #!/bin/bash |
| # vm-setup.sh |
| # |
| # This script installs ONOS dependencies and installs a desktop environment on a Miniet VM. |
| |
| |
| export CURRENT_USER=sdnip |
| export USER_HOME=/home/${CURRENT_USER} |
| |
| # -------------- Setup keys ------------------- |
| |
| mkdir -p ~/.ssh |
| ssh-keygen -t dsa -P "" -f .ssh/id_dsa |
| cp .ssh/id_dsa.pub .ssh/authorized_keys |
| |
| # -------------- Setup Desktop --------------- |
| |
| DESKTOP=${USER_HOME}/Desktop |
| |
| mkdir -p ${DESKTOP} |
| |
| cat > ${DESKTOP}/ONOS << EOF |
| [Desktop Entry] |
| Encoding=UTF-8 |
| Type=Application |
| Name=ONOS |
| Name[en_US]=ONOS |
| Icon=konsole |
| Exec=/usr/bin/lxterminal -e '/opt/onos/apache-karaf-3.0.2/bin/client -u karaf' |
| Comment[en_US]= |
| EOF |
| |
| cat > "${DESKTOP}/SDN-IP Mininet" << EOF |
| [Desktop Entry] |
| Encoding=UTF-8 |
| Type=Application |
| Name=SDN-IP Mininet |
| Name[en_US]=SDN-IP Mininet |
| Icon=konsole |
| Exec=/usr/bin/lxterminal -e 'sudo mn --custom /home/sdnip/sdnip/tutorial.py --topo sdnip --controller remote --nolistenport' |
| Comment[en_US]= |
| EOF |
| |
| cat > ${DESKTOP}/Tutorial << EOF |
| [Desktop Entry] |
| Encoding=UTF-8 |
| Type=Application |
| Name=SDN-IP Tutorial |
| Name[en_US]=SDN-IP Tutorial |
| Icon=internet-web-browser |
| Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/SDN-IP+Tutorial |
| Comment[en_US]= |
| EOF |
| |
| cat > ${DESKTOP}/GUI << EOF |
| [Desktop Entry] |
| Encoding=UTF-8 |
| Type=Application |
| Name=ONOS GUI |
| Name[en_US]=ONOS GUI |
| Icon=internet-web-browser |
| Exec=/usr/bin/chromium-browser http://localhost:8181/onos/ui/index.html#topo |
| 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}/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 'sudo service onos restart' |
| Comment[en_US]= |
| EOF |
| |
| |
| echo "sudo service onos start > /dev/null 2>&1" >> ~/.profile |