better autoconf checks
authorChristian Weiske <cweiske@cweiske.de>
Sun, 6 Feb 2011 12:02:58 +0000 (13:02 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Sun, 6 Feb 2011 12:02:58 +0000 (13:02 +0100)
munin/usb-wde1_

index 44443a8..c077ea2 100755 (executable)
@@ -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