summaryrefslogtreecommitdiff
path: root/scripts/trollette.sh
diff options
context:
space:
mode:
authorFlorian <stayawake@lavabit.com>2013-05-04 00:11:07 +0200
committerFlorian <stayawake@lavabit.com>2013-05-04 00:11:40 +0200
commit2f0fca884cb1b036fc74e13af718bfd23f4194ea (patch)
tree94546bf04ceaa1b72b0d01d317009c3772d13c9f /scripts/trollette.sh
parentf84a06f37ea4f9b79aaa6b1aebc46d6f2c80ac78 (diff)
added trollettenscript
Diffstat (limited to 'scripts/trollette.sh')
-rwxr-xr-xscripts/trollette.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/trollette.sh b/scripts/trollette.sh
new file mode 100755
index 0000000..e63663f
--- /dev/null
+++ b/scripts/trollette.sh
@@ -0,0 +1,29 @@
+#!/bin/zsh
+
+WEBPATH="../"
+NAME="klo"
+TIMESTAMP="yes"
+BILD=`python2 trollette.py`
+
+
+TODAY=`date`
+TIME=`date +"%H"`
+
+cp $BILD ${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 +noise Gaussian -attenuate 0.4 -adaptive-sharpen 3 -resize 208x117 ${WEBPATH}/public/img/buffer.thumb.${NAME}.webcam.jpg
+
+if [ x"${TIMESTAMP}" == x"yes" ]; then
+ if [ $TIME -lt 6 ] || [ $TIME -ge 18 ]; then
+ mogrify +noise Gaussian -attenuate 0.4 -adaptive-sharpen 3 -fill white -gravity SouthEast -draw "text 10,10 '${TODAY}'" ${WEBPATH}/public/img/buffer.${NAME}.webcam.jpg
+ else
+ mogrify -contrast-stretch 0 -adaptive-sharpen 3 -fill black -gravity SouthEast -draw "text 10,10 '${TODAY}'" ${WEBPATH}/public/img/buffer.${NAME}.webcam.jpg
+ fi
+ fi
+
+ 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
+