show last job running instead of first one
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 20 Apr 2019 13:29:06 +0000 (15:29 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 20 Apr 2019 13:29:06 +0000 (15:29 +0200)
gnt-running.sh

index 97e51d6..8821685 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh -e
 while true ; do
-  JOBID=`gnt-job list --no-headers --running | tee /dev/stderr | awk '{ print $1; exit }'`
+  JOBID=`gnt-job list --no-headers --running | tee /dev/stderr | tail -1 | awk '{ print $1; exit }'`
   if [ -n "$JOBID" ]
   then
        gnt-job watch $JOBID || true # don't exit on failed jobs