create correct Location: header which kindle's wget can handle
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 29 Jul 2017 10:59:27 +0000 (12:59 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 29 Jul 2017 10:59:27 +0000 (12:59 +0200)
temp2.sh

index 5d6fd76..ecdc250 100755 (executable)
--- a/temp2.sh
+++ b/temp2.sh
@@ -1,5 +1,7 @@
 #!/bin/sh -x
 
+# sudo apt-get install jq
+#
 # install as cgi-script and invoke to get png
 
 #ssh rpi 'cat `ls -t /dev/shm/vaillant.* | head -1` | sed "s/  .*| */ /"' > /dev/shm/temp.tsv
@@ -18,7 +20,7 @@ gnuplot -e "t_mean=`head -1 /dev/shm/temperature.mean.spread`;t_spread=`tail -1
 convert /dev/shm/temp2.png -gravity center -extent 600x800 -colorspace Gray /dev/shm/temp2-gray.png
 # ln -s /dev/shm/temp2-gray.png /var/www/html/temp2.png 
 
-echo Location: temp2.png
+echo "Location: $REQUEST_SCHEME://$SERVER_NAME:$SERVER_PORT/temp2.png"
 echo
 
 exit 0