blob: 7c9643fd076dfdb436f25a323b3ecebc0ea5f64b [file] [log] [blame]
Thomas Vachuska5f54c6f2016-05-04 19:19:51 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Runs ONOS from distributable onos.tar.gz
4# -----------------------------------------------------------------------------
5
6ONOS_TAR=
7
8cd /tmp
9
10# Kill any running instances
11[ -f /tmp/onos.pid ] && kill -9 $(cat /tmp/onos.pid) &>/dev/null
12
13set -e
14
15# Blitz previously unrolled onos- directory
16rm -fr onos-*
17
18# Unroll new image from the specified tar file
19[ -f $ONOS_TAR ] && tar zxf $ONOS_TAR
20
21# Change into the ONOS home directory
22cd onos-*
23export ONOS_HOME=$PWD
24
25# FIXME: for now we're running using the karaf client; later use raw SSH
26unset ONOS_USE_SSH
27
28# Start ONOS as a server, but include any specified options
29./bin/onos-service server "$@" &>onos.log &
30echo "$!" > /tmp/onos.pid
31
32# Hang-on a bit and then start tailing the ONOS log output
33sleep 1
34tail -f ./apache*/data/log/karaf.log