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 510f3f7..169fd76 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