#!/bin/sh # Script zum Abholen und Abspeichern der Kamerabilder # für den virtuellen Mobotix-Cambetrieb # (c) Michael Nausch # # v0.01 : 2008-12-29 # v0.02 : 2013-03-16 # v0.03 : 2014-01-10 CAMURL_1="http://10.0.10.17/record/current.jpg" CAMURL_2="http://10.0.10.18/record/current.jpg" WORKDIR_1="/var/www/webcam/cache/" WORKDIR_2="/var/www/webcam/record/" WORKFILE_1="west_current.jpg" WORKFILE_2="ost_current.jpg" PRG=/usr/bin/convert WORKDIR_2="/var/www/webcam/record/" FILE_1="current.jpg" cd $WORKDIR_1 while true do PIC_DAY=`date +%d` PIC_MONTH=`date +%m` PIC_YEAR=`date +%Y` PIC_HOURS=`date +%H` PIC_MINUTES=`date +%M` PIC_SECONDS=`date +%S` PIC_DATE=$PIC_DAY"."$PIC_MONTH"."$PIC_YEAR" - "$PIC_HOURS":"$PIC_MINUTES":"$PIC_SECONDS DATA_1=`cat /usr/local/var/wview/img/m25-west-display.htm` DATA_2=`cat /usr/local/var/wview/img/m25-ost-display.htm` wget --user="webcam_user" --password="Django-1$-4-G33k!" $CAMURL_1 $PRG -gravity northwest -fill black -pointsize 25 -draw "text 7,6 '$DATA_1'" current.jpg $WORKFILE_1 $PRG -gravity northwest -fill white -pointsize 25 -draw "text 5,5 '$DATA_1'" $WORKFILE_1 $WORKFILE_1 $PRG -gravity northeast -fill black -pointsize 25 -draw "text 5,6 '$PIC_DATE'" $WORKFILE_1 $WORKFILE_1 $PRG -gravity northeast -fill white -pointsize 25 -draw "text 7,5 '$PIC_DATE'" $WORKFILE_1 $WORKFILE_1 convert -geometry 320x180 $WORKDIR_1$WORKFILE_1 $WORKDIR_1"current_small.jpg" convert -geometry 1000x533 $WORKDIR_1$WORKFILE_1 $WORKDIR_1"current_big.jpg" mv $WORKDIR_1$WORKFILE_1 $WORKDIR_1"current_hd.jpg" rm current.jpg wget --user="webcam_user" --password="Django-1$-4-G33k!" $CAMURL_2 $PRG -gravity northwest -fill black -pointsize 25 -draw "text 7,6 '$DATA_2'" current.jpg $WORKFILE_2 $PRG -gravity northwest -fill white -pointsize 25 -draw "text 5,5 '$DATA_2'" $WORKFILE_2 $WORKFILE_2 $PRG -gravity northeast -fill black -pointsize 25 -draw "text 5,6 '$PIC_DATE'" $WORKFILE_2 $WORKFILE_2 $PRG -gravity northeast -fill white -pointsize 25 -draw "text 7,5 '$PIC_DATE'" $WORKFILE_2 $WORKFILE_2 convert -geometry 320x180 $WORKDIR_1$WORKFILE_2 $WORKDIR_1"current_2_small.jpg" convert -geometry 1000x533 $WORKDIR_1$WORKFILE_2 $WORKDIR_1"current_2_big.jpg" mv $WORKDIR_1$WORKFILE_2 $WORKDIR_1"current_2_hd.jpg" rm current.jpg done