show last values from sensors
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 17 Feb 2021 09:59:36 +0000 (10:59 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 17 Feb 2021 09:59:36 +0000 (10:59 +0100)
last-heartbeat.sh [new file with mode: 0755]

diff --git a/last-heartbeat.sh b/last-heartbeat.sh
new file mode 100755 (executable)
index 0000000..cd7128a
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+
+ls -d queue/*/$( date +%Y-%m-%d ) | while read path ; do
+       last=$( ls -t $path | head -1 )
+       if [ ! -z "$1" ] ; then
+               imei=$( echo $path | cut -d/ -f2 )
+               echo -n "$path/$last "
+               grep $imei subvision-numbers.txt
+       else
+               echo "$path/$last"
+       fi
+done
+