From d83d1c5a314f3044bc1710008e07afd4ef694407 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 17 Jul 2013 11:38:14 +0100 Subject: [PATCH] Add the script to fetch stats from ADSL modem. --- getstats.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/getstats.sh b/getstats.sh index a19a965..7747afb 100755 --- a/getstats.sh +++ b/getstats.sh @@ -2,4 +2,10 @@ statsfile=${statsfile:-/var/lib/munin/plugin-state/huawei-hg612-munin-output.txt} -expect `dirname $0`/huawei.expect | tee | tr -d "\015" > $statsfile +expect `dirname $0`/huawei.expect | tee | tr -d "\015" > $statsfile.new + +if [ -s "$statsfile.new" ]; then + mv $statsfile.new $statsfile +else + echo "Empty output from expect script" +fi