Skip to content
Snippets Groups Projects
Select Git revision
  • 4c1a9d978328c9ccd0e18e9d4aab61fe9a3c5bd3
  • master default protected
2 results

zoneminder_controller.sh

Blame
  • zoneminder_controller.sh 800 B
    #!/bin/bash
    
    $OLDZONES=""
    
    while true
    do
    
    ZONES=`wget -O- 'http://localhost/zm/index.php?view=events&page=&reload=0&execute=0&action=&subaction=&line=&fid=&filterName=motion&filter%5Bterms%5D%5B0%5D%5Battr%5D=Cause&filter%5Bterms%5D%5B0%5D%5Bop%5D=%3D&filter%5Bterms%5D%5B0%5D%5Bval%5D=Motion&filter%5Bterms%5D%5B1%5D%5Bcnj%5D=and&filter%5Bterms%5D%5B1%5D%5Battr%5D=DateTime&filter%5Bterms%5D%5B1%5D%5Bop%5D=%3E&filter%5Bterms%5D%5B1%5D%5Bval%5D=15+seconds+ago&sort_field=DateTime&sort_asc=1&limit=1&AutoExecuteCmd=' | grep -o 'zone.'`
    
    
    if [ "$OLDZONES" != "$ZONES" ]
    then
    	OLDZONES="$ZONES"
    
    	COMMAND="composite "; for ZONE in $ZONES; do COMMAND+="-compose plus $ZONE.png "; done 
    	COMMAND+=" -compose plus black.png black.png rgba:image_fifo"
    
    	echo $COMMAND
    	$COMMAND
    
    	sleep 3
    fi
    
    sleep 1
    
    done