From: Christian Weiske Date: Sun, 6 Feb 2011 12:02:58 +0000 (+0100) Subject: better autoconf checks X-Git-Tag: v1.0.0~43 X-Git-Url: https://git.cweiske.de/usb-wde1-tools.git/commitdiff_plain/34039bfad476a917201c56883645e4fbf551b4c7 better autoconf checks --- 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