From f9897bf04125d9877f182a34c5bc09dae7fd8088 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Wed, 6 Apr 2011 07:14:41 +0200 Subject: Rework camscripts, add dachcam --- scripts/dachcam | 10 ++++++++++ scripts/rackcam | 10 ++++++++++ scripts/webcamscript | 20 +++++++++++--------- 3 files changed, 31 insertions(+), 9 deletions(-) create mode 100755 scripts/dachcam create mode 100755 scripts/rackcam mode change 100755 => 100644 scripts/webcamscript (limited to 'scripts') diff --git a/scripts/dachcam b/scripts/dachcam new file mode 100755 index 0000000..78b4f93 --- /dev/null +++ b/scripts/dachcam @@ -0,0 +1,10 @@ +#!/bin/bash + +URL="http://172.22.83.12/webcam/webcam.png" # This actually is a jpeg... +NAME="dach" + +TIMESTAMP="no" + +. webcamscript + +exit 0 diff --git a/scripts/rackcam b/scripts/rackcam new file mode 100755 index 0000000..5e3908e --- /dev/null +++ b/scripts/rackcam @@ -0,0 +1,10 @@ +#!/bin/bash + +URL="http://taifun.local.sublab.org/webcam.jpg" +NAME="rack" + +TIMESTAMP="yes" + +. webcamscript + +exit 0 diff --git a/scripts/webcamscript b/scripts/webcamscript old mode 100755 new mode 100644 index c48a0a2..9b61eb3 --- a/scripts/webcamscript +++ b/scripts/webcamscript @@ -5,16 +5,18 @@ TODAY=`date` TIME=`date +"%H"` -wget http://taifun.local.sublab.org/webcam.jpg -O ${WEBPATH}/public/img/buffer.rack.webcam.jpg &> /dev/null || exit 1 +wget "${URL}" -O ${WEBPATH}/public/img/buffer.${NAME}.webcam.jpg &> /dev/null || exit 1 -cp ${WEBPATH}/public/img/buffer.rack.webcam.jpg ${WEBPATH}/public/img/buffer.thumb.rack.webcam.jpg -mogrify -resize 200x150 ${WEBPATH}/public/img/buffer.thumb.rack.webcam.jpg -if [ $TIME -lt 6 ] || [ $TIME -ge 18 ]; then - mogrify -fill white -gravity SouthEast -draw "text 10,10 '${TODAY}'" ${WEBPATH}/public/img/buffer.rack.webcam.jpg -else - mogrify -fill black -gravity SouthEast -draw "text 10,10 '${TODAY}'" ${WEBPATH}/public/img/buffer.rack.webcam.jpg +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 +if [ x"${TIMESTAMP}" == x"yes" ]; then + if [ $TIME -lt 6 ] || [ $TIME -ge 18 ]; then + mogrify -fill white -gravity SouthEast -draw "text 10,10 '${TODAY}'" ${WEBPATH}/public/img/buffer.${NAME}.webcam.jpg + else + mogrify -fill black -gravity SouthEast -draw "text 10,10 '${TODAY}'" ${WEBPATH}/public/img/buffer.${NAME}.webcam.jpg + fi fi -mv -f ${WEBPATH}/public/img/buffer.rack.webcam.jpg ${WEBPATH}/public/img/rack.webcam.jpg &> /dev/null -mv -f ${WEBPATH}/public/img/buffer.thumb.rack.webcam.jpg ${WEBPATH}/public/img/thumb.rack.webcam.jpg &> /dev/null +mv -f ${WEBPATH}/public/img/buffer.${NAME}.webcam.jpg ${WEBPATH}/public/img/${NAME}.webcam.jpg &> /dev/null +mv -f ${WEBPATH}/public/img/buffer.thumb.${NAME}.webcam.jpg ${WEBPATH}/public/img/thumb.${NAME}.webcam.jpg &> /dev/null exit 0 -- cgit v1.2.1