blob: f6e8f9b230b17e9e74f52ad47b04f04a24cc4366 [file] [log] [blame]
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Untars ONOS tar.gz on the remote machine and runs ONOS.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
9node=${1:-$OCI}
10remote=$ONOS_USER@$node
11
12ssh $remote "
13 [ -d $ONOS_INSTALL_DIR/bin ] && echo \"ONOS is already installed\" && exit 1
14 cd /tmp && rm -fr /tmp/$ONOS_BITS
15 tar zxf /tmp/$ONOS_BITS.tar.gz
16
17 cd /tmp/$ONOS_BITS
Thomas Vachuska12bf4452015-06-26 09:15:38 -070018 export ONOS_NIC=$ONOS_NIC
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -070019 bin/onos-service server 1>/tmp/onos.out 2>/tmp/onos.err &
20
Thomas Vachuska750ab042015-06-17 10:42:15 -070021 # Setup a few symlinks to allow other tools to work
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -070022 sudo ln -s /tmp/$ONOS_BITS $ONOS_INSTALL_DIR
Thomas Vachuska750ab042015-06-17 10:42:15 -070023 sudo ln -s /tmp/$ONOS_BITS/$KARAF_DIST/data/log $ONOS_INSTALL_DIR/log
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -070024"