blob: 1a205f4767bb04a10bd1c3ed419b2a0e92a01887 [file] [log] [blame]
#!/bin/bash
#-------------------------------------------------------------------------------
# Monitors remote ONOS log file.
#-------------------------------------------------------------------------------
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
remote=$ONOS_USER@${1:-$OCI}
LOG=$ONOS_INSTALL_DIR/log/karaf.log
trap "ssh $remote 'ps -ef | grep \"tail -n 512\" | grep -v grep | cut -c10-15 | xargs kill'" EXIT
ssh $remote "
while true; do
echo ==================================================================
[ ! -f $LOG ] && sleep 2 && continue
tail -n 512 --follow=name $LOG --sleep-interval 2
done
"