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