From 5e1bb24194f6b8b12e99ca76bc62ca868a46a7f0 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 8 Feb 2011 19:21:26 +0100 Subject: [PATCH 1/1] verify that the log timestamp is not too old --- munin/usb-wde1_ | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/munin/usb-wde1_ b/munin/usb-wde1_ index 9bd730f..950c6a7 100755 --- a/munin/usb-wde1_ +++ b/munin/usb-wde1_ @@ -107,19 +107,23 @@ fi #split by semicolons OLDIFS="$IFS" IFS=";" -read -r startzeichen zustand zeitstempel\ +read -r sign state timestamp\ t0 t1 t2 t3 t4 t5 t6 t7\ h0 h1 h2 h3 h4 h5 h6 h7\ tc hc ws ns rain checksum\ < "$logfile" IFS=$OLDIFS -if [ "$startzeichen" != '$1' ]; then +if [ "$sign" != '$1' ]; then echo Log line does not begin with \$1 exit 2 fi -#FIXME: check timestamp +curdate=`date +%s` +if [ "$timestamp" -lt `expr $curdate - 600` ]; then + #timestamp is too old, data are too old + exit +fi if [ "$TYPE" = "temperature" ]; then -- 2.30.2