blob: 6741df62091610a7ce5b02b830bde42254f3aafa [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 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 Vachuskacd443da2017-01-10 17:18:39 -080022 sudo ln -s $ONOS_TMP $ONOS_INSTALL_DIR
23 sudo ln -s $ONOS_TMP/$KARAF_DIST/data/log $ONOS_INSTALL_DIR/log
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -070024"