From 34039bfad476a917201c56883645e4fbf551b4c7 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sun, 6 Feb 2011 13:02:58 +0100 Subject: [PATCH] better autoconf checks --- munin/usb-wde1_ | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/munin/usb-wde1_ b/munin/usb-wde1_ index 44443a8..c077ea2 100755 --- a/munin/usb-wde1_ +++ b/munin/usb-wde1_ @@ -28,11 +28,15 @@ usb-wde1 - Munin plugin to report usb-wde1 temperature and humidity data =cut +TYPE=`basename $0 | sed 's/^.*_//g'` + if [ "$1" = "autoconf" ]; then - if [ -r "$logfile" ]; then - echo yes - else + if [ ! -r "$logfile" ]; then echo "no (Logfile \"$logfile\" does not exist)" + elif [ "$TYPE" != "temperature" -a "$TYPE" != "humidity" ]; then + echo "no (Type \"$TYPE\" not supported, try \"./usb-wde1_ suggest\")" + else + echo yes fi exit 0 @@ -44,7 +48,6 @@ fi #load variables -TYPE=`basename $0 | sed 's/^.*_//g'` if [ "$1" = "config" ]; then -- 2.30.2