diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/pingscript | 2 | ||||
-rwxr-xr-x | scripts/temperaturescript.sh | 20 | ||||
-rw-r--r-- | scripts/webcamscript | 2 |
3 files changed, 22 insertions, 2 deletions
diff --git a/scripts/pingscript b/scripts/pingscript index 55e0b65..bfdbbc7 100755 --- a/scripts/pingscript +++ b/scripts/pingscript @@ -22,7 +22,7 @@ insertstatus() { apistatus() { [ -d "${WEBPATH}/public/api" ] || mkdir -p "${WEBPATH}/public/api" if [ "`cat \"${WEBPATH}/public/api/status\" 2>/dev/null`" != "$1" ]; then - wget -q http://127.0.0.1:8042/send "--post-data=message=sublab status is now: $1" + wget -q http://127.0.0.1:8042/send -O /dev/null "--post-data=message=sublab status is now: $1" fi echo $1 > "${WEBPATH}/public/api/status" } diff --git a/scripts/temperaturescript.sh b/scripts/temperaturescript.sh new file mode 100755 index 0000000..df13b38 --- /dev/null +++ b/scripts/temperaturescript.sh @@ -0,0 +1,20 @@ +#!/bin/bash +#script to fetch latest temperature graph and resize it. + + +URL="http://taifun.local.sublab.org/temperature/temp-2hour.png" +WEBPATH=../ + +wget ${URL} -O ${WEBPATH}/public/img/buffer.tempgraph.png &> /dev/null || exit 1 + +cp ${WEBPATH}/public/img/buffer.tempgraph.png ${WEBPATH}/public/img/buffer.thumb.tempgraph.png + +mogrify -crop 800x400+70+41 -contrast-stretch 0 -resize 200x50 -contrast-stretch 0 ${WEBPATH}/public/img/buffer.thumb.tempgraph.png + +mv -f ${WEBPATH}/public/img/buffer.tempgraph.png ${WEBPATH}/public/img/tempgraph.png &> /dev/null + +mv -f ${WEBPATH}/public/img/buffer.thumb.tempgraph.png ${WEBPATH}/public/img/thumb.tempgraph.png &> /dev/null + + + + diff --git a/scripts/webcamscript b/scripts/webcamscript index 883ef79..4e83c9a 100644 --- a/scripts/webcamscript +++ b/scripts/webcamscript @@ -8,7 +8,7 @@ TIME=`date +"%H"` wget "${URL}" $WGET_ARGS -O ${WEBPATH}/public/img/buffer.${NAME}.webcam.jpg &> /dev/null || exit 1 cp ${WEBPATH}/public/img/buffer.${NAME}.webcam.jpg ${WEBPATH}/public/img/buffer.thumb.${NAME}.webcam.jpg -mogrify -resize 200x150 ${WEBPATH}/public/img/buffer.thumb.${NAME}.webcam.jpg +mogrify -contrast-stretch 0 -resize 200x150 ${WEBPATH}/public/img/buffer.thumb.${NAME}.webcam.jpg if [ x"${TIMESTAMP}" == x"yes" ]; then if [ $TIME -lt 6 ] || [ $TIME -ge 18 ]; then mogrify -contrast-stretch 0 -adaptive-sharpen 3 -fill white -gravity SouthEast -draw "text 10,10 '${TODAY}'" ${WEBPATH}/public/img/buffer.${NAME}.webcam.jpg |