more error checking for xsl path
[munin-heatpump.git] / heatpump-dimplex-wpm_
index 510f3f72ecd0c93e1ff9a3bc5c78648766f88123..169fd76063993a122bc1e0faaeddb01ae5c47324 100755 (executable)
@@ -108,10 +108,20 @@ if [ "$ret" -ne 0 ]; then
     exit 1
 fi
 
-path="`dirname "$0"`"
-data=`echo "$xml" | xsltproc "$path/paths.xsl" -`; ret=$?
+xslfile=paths.xsl
+if [ ! -f "$xslfile" ]; then
+    shell="`readlink -f "$0"`"
+    path="`dirname "$0"`"
+    xslfile="$path/paths.xsl"
+    if [ ! -f "$xslfile" ]; then
+        echo 'Could not find paths.xsl'
+        exit 2
+    fi
+fi
+
+data=`echo "$xml" | xsltproc "$xslfile" -`; ret=$?
 if [ "$ret" -ne 0 ]; then
-    echo "Error running xsltproc"
+    echo 'Error running xsltproc'
     exit 2
 fi