| # ----------------------------------------------------------------------------- |
| # Runs ONOS from distributable onos.tar.gz |
| # ----------------------------------------------------------------------------- |
| # Kill any running instances |
| [ -f /tmp/onos.pid ] && kill -9 $(cat /tmp/onos.pid) &>/dev/null |
| # Blitz previously unrolled onos- directory |
| # Unroll new image from the specified tar file |
| [ -f $ONOS_TAR ] && tar zxf $ONOS_TAR |
| # Change into the ONOS home directory |
| # FIXME: for now we're running using the karaf client; later use raw SSH |
| # Start ONOS as a server, but include any specified options |
| ./bin/onos-service server "$@" &>onos.log & |
| echo "$!" > /tmp/onos.pid |
| # Hang-on a bit and then start tailing the ONOS log output |
| echo "Waiting for karaf.log" |
| until [ $RETRY_COUNT -le 0 ]; do |
| KARAF_LOG=$(find $ONOS_HOME -type f -name karaf.log) |
| RETRY_COUNT=$[$RETRY_COUNT-1] |
| echo "Fail to open karaf.log" |