#/bin/bash capture aperture if [ $? != '0' ]; then capture start if [ $? != '0' ]; then echo "capture failure" exit 1 fi capture 'qual fine' capture 'size large' capture 'zoom 0' echo -n Undefined > cameradayornight.txt fi dayornight=$(php dayornight.php) if [ -e cameradayornight.txt ]; then cameradayornight=$(cat cameradayornight.txt) else cameradayornight='Undefined' fi echo "DayOrNight: $dayornight" echo "CameraDayOrNight: $cameradayornight" if [ "$dayornight" != "$cameradayornight" ]; then #switch mode if [ "$dayornight" == "Day" ]; then echo "Switching to day mode" capture 'qual fine' capture 'shutter 1/125' capture 'tv/av program' else echo "Switching to night mode" capture 'tv/av manual' capture 'qual normal' capture 'shutter 15"' capture 'aperture 4.0' fi fi echo -n $dayornight > cameradayornight.txt # # now capture the image capture 'capture /home/fabrizio/scripts/canon/latest.jpg' # ......