From 9b1ce0ca93efc03ddc063c339b5ec501dfa9ef83 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sun, 9 Dec 2012 20:56:45 +0100 Subject: [PATCH] more error checking for xsl path --- heatpump-dimplex-wpm_ | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/heatpump-dimplex-wpm_ b/heatpump-dimplex-wpm_ index 510f3f7..169fd76 100755 --- a/heatpump-dimplex-wpm_ +++ b/heatpump-dimplex-wpm_ @@ -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 -- 2.30.2