blob: 7438e57df2f15e85d9c37741051bbfd54131fdb9 [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
Thomas Vachuskacd443da2017-01-10 17:18:39 -08008export ONOS_TMP=/tmp/onos-$ONOS_POM_VERSION
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -07009
10node=${1:-$OCI}
11remote=$ONOS_USER@$node
12
13ssh $remote "
14 [ -d $ONOS_INSTALL_DIR/bin ] && echo \"ONOS is already installed\" && exit 1
Thomas Vachuskacd443da2017-01-10 17:18:39 -080015 cd /tmp && rm -fr $ONOS_TMP
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -070016 tar zxf /tmp/$ONOS_BITS.tar.gz
17
Thomas Vachuskacd443da2017-01-10 17:18:39 -080018 cd $ONOS_TMP
Thomas Vachuska12bf4452015-06-26 09:15:38 -070019 export ONOS_NIC=$ONOS_NIC
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -070020 bin/onos-service server 1>/tmp/onos.out 2>/tmp/onos.err &
21
Thomas Vachuska750ab042015-06-17 10:42:15 -070022 # Setup a few symlinks to allow other tools to work
Thomas Vachuskacd443da2017-01-10 17:18:39 -080023 sudo ln -s $ONOS_TMP $ONOS_INSTALL_DIR
24 sudo ln -s $ONOS_TMP/$KARAF_DIST/data/log $ONOS_INSTALL_DIR/log
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -070025"