summaryrefslogtreecommitdiff
path: root/scripts/webcamscript
blob: c48a0a20129601b3b57a69a3432fbd419a76fd23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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