more error checking for xsl path
authorChristian Weiske <cweiske@cweiske.de>
Sun, 9 Dec 2012 19:56:45 +0000 (20:56 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Sun, 9 Dec 2012 19:56:45 +0000 (20:56 +0100)
heatpump-dimplex-wpm_

index 510f3f72ecd0c93e1ff9a3bc5c78648766f88123..169fd76063993a122bc1e0faaeddb01ae5c47324 100755 (executable)
@@ -108,10 +108,20 @@ if [ "$ret" -ne 0 ]; then
     exit 1
 fi
 
     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
 if [ "$ret" -ne 0 ]; then
-    echo "Error running xsltproc"
+    echo 'Error running xsltproc'
     exit 2
 fi
 
     exit 2
 fi