chbrightness.sh
then I made 2 .sql files that have the settings I wish to change..#!/bin/sh
if [ "$1" = "day" ];then
mysql -u YOURUSER --password=YOURPASS zm < /path/to/day.contrast.sql
killall -9 zmc
elif [ "$1" = "night" ];then
mysql -u YOURUSER --password=YOURPASS zm < /path/to/night.contrast.sql
killall -9 zmc
else
echo DAY? OR NIGHT?
fi
day.contrast.sql (change ID = to your camera ID)
and night.contrast.sql (again, change ID = to your camera ID)UPDATE `Monitors` SET `Host` = NULL ,
`Path` = NULL ,
`Brightness` = '32768' WHERE `Id` = '1' LIMIT 1 ;
now you should be able to run "./chbrightness.sh day" and watch your camera switch its brightness to how you would like it in the day, then try "./chbrightness.sh night" and it should switch to your evening contrast settings..UPDATE `Monitors` SET `Host` = NULL ,
`Path` = NULL ,
`Brightness` = '42768' WHERE `Id` = '1' LIMIT 1 ;
then I got a program called 'sunwait' that waits until sunrise or sunset from
http://www.risacher.org/sunwait/
build and install it somewhere and then locate the longitude and latitude for your location.. a simple search of google should find this (try: latitude and longitude for YOURCITY)
and here is my crontab that starts the program at 6am then waits til sunrise and executes the change, then at 5pm it does the same.. here the sun never rises before 6am and never sets before 5pm so I felt these were good times..
00 6 * * * /usr/local/bin/sunwait sun up 37.23N, 97.20W ; /path/to/chbrightness.sh day
00 17 * * * /usr/local/bin/sunwait sun down 37.23N, 97.20W ; /path/to/chbrightness.sh night