Thomas Vachuska | a48e3d1 | 2015-06-02 09:43:29 -0700 | [diff] [blame] | 1 | #!/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 Vachuska | cd443da | 2017-01-10 17:18:39 -0800 | [diff] [blame] | 8 | export ONOS_TMP=/tmp/onos-$ONOS_POM_VERSION |
Thomas Vachuska | a48e3d1 | 2015-06-02 09:43:29 -0700 | [diff] [blame] | 9 | |
| 10 | node=${1:-$OCI} |
| 11 | remote=$ONOS_USER@$node |
| 12 | |
| 13 | ssh $remote " |
| 14 | [ -d $ONOS_INSTALL_DIR/bin ] && echo \"ONOS is already installed\" && exit 1 |
Thomas Vachuska | cd443da | 2017-01-10 17:18:39 -0800 | [diff] [blame] | 15 | cd /tmp && rm -fr $ONOS_TMP |
Thomas Vachuska | a48e3d1 | 2015-06-02 09:43:29 -0700 | [diff] [blame] | 16 | tar zxf /tmp/$ONOS_BITS.tar.gz |
| 17 | |
Thomas Vachuska | cd443da | 2017-01-10 17:18:39 -0800 | [diff] [blame] | 18 | cd $ONOS_TMP |
Thomas Vachuska | 12bf445 | 2015-06-26 09:15:38 -0700 | [diff] [blame] | 19 | export ONOS_NIC=$ONOS_NIC |
Thomas Vachuska | a48e3d1 | 2015-06-02 09:43:29 -0700 | [diff] [blame] | 20 | bin/onos-service server 1>/tmp/onos.out 2>/tmp/onos.err & |
| 21 | |
Thomas Vachuska | 750ab04 | 2015-06-17 10:42:15 -0700 | [diff] [blame] | 22 | # Setup a few symlinks to allow other tools to work |
Thomas Vachuska | cd443da | 2017-01-10 17:18:39 -0800 | [diff] [blame] | 23 | sudo ln -s $ONOS_TMP $ONOS_INSTALL_DIR |
| 24 | sudo ln -s $ONOS_TMP/$KARAF_DIST/data/log $ONOS_INSTALL_DIR/log |
Thomas Vachuska | a48e3d1 | 2015-06-02 09:43:29 -0700 | [diff] [blame] | 25 | " |