From c7cd9394f43a2813397efee981914159e03530cf Mon Sep 17 00:00:00 2001 From: Level2 Pidor Date: Sun, 31 Jan 2016 23:28:55 +0100 Subject: [PATCH] added message when the average is changing --- scripts/peoplecounter-realtime.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/peoplecounter-realtime.sh b/scripts/peoplecounter-realtime.sh index 6ebb1f6..dfe89af 100755 --- a/scripts/peoplecounter-realtime.sh +++ b/scripts/peoplecounter-realtime.sh @@ -71,7 +71,13 @@ do echo "$p" > "$MAXFILE" fi fi - getaveragepeople > "$PRESENCY" + oldaverage="$(cat "$PRESENCY")" + newaverage=$(getaveragepeople) + if [ "$oldaverage" -ne "$newaverage" ] + then + logger $(basename $0) updated precency average from $oldaverage to $newaverage people + echo "$newaverage" > "$PRESENCY" + fi if [ "$state" = "offline" ] then state="online"