stop killing randomly, when using less mode
Change-Id: I59f52622a32f82a81b4b237aff2e7f3cfd89e96f
diff --git a/tools/test/bin/onos-log b/tools/test/bin/onos-log
index ff52eee..38ff50c 100755
--- a/tools/test/bin/onos-log
+++ b/tools/test/bin/onos-log
@@ -19,11 +19,11 @@
LOG=$ONOS_INSTALL_DIR/$KARAF_DIST/instances/$instance/data/log/karaf.log || \
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
if [ $less -eq 1 ]; then
ssh -t $remote "less $LOG"
else
+ trap "ssh $remote 'ps -ef | grep \"tail -n 512\" | grep -v grep | cut -c10-15 | xargs kill'" EXIT
ssh $remote "
while true; do
echo ==================================================================