summaryrefslogtreecommitdiff
path: root/scripts/webcamscript
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2011-03-18 23:28:52 +0100
committerroot <root@oberon.sublab.org>2011-03-19 13:17:49 +0100
commit5ee8fd94512d7f4ea7d49310dc8e1151ef833cac (patch)
tree0eff21b44c1491e6197d9b99b0df13ebed324361 /scripts/webcamscript
Initial commit
Diffstat (limited to 'scripts/webcamscript')
-rwxr-xr-xscripts/webcamscript20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/webcamscript b/scripts/webcamscript
new file mode 100755
index 0000000..c48a0a2
--- /dev/null
+++ b/scripts/webcamscript
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+. settings
+
+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
+
+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
+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
+exit 0