add connection error checking
authorChristian Weiske <cweiske@cweiske.de>
Sun, 9 Dec 2012 19:48:13 +0000 (20:48 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Sun, 9 Dec 2012 19:48:13 +0000 (20:48 +0100)
heatpump-dimplex-wpm_

index 0539946..cbdf74f 100755 (executable)
@@ -102,7 +102,13 @@ if [ "$1" = "config" ]; then
     exit 0
 fi
 
-data=`curl -s "http://$host/usr-cgi/xml.cgi?A|1|125|D|1|150|I|1|100" | xsltproc paths.xsl -`
+xml=`curl -fs "http://$host/usr-cgi/xml.cgi?A|1|125|D|1|150|I|1|100"`; ret=$?
+if [ "$ret" -ne 0 ]; then
+    echo "Error fetching data from heatpump server: $host"
+    exit 1
+fi
+
+data=`echo "$xml" | xsltproc paths.xsl -`
 
 #Outdoor temperature
 echo 'multigraph heatpump_dimplex_wpm_outtemp'