When using the raspberry pi camera, it is usefull to only take images when there is suffcient light. Based on the command line below it is possible to check if the current time is within the sunrise and sunset time,

echo Sunrise is at `l=12776844;curl -s http://weather.yahooapis.com/forecastrss?w=$l|grep astronomy| awk -F\" '{print $2}'`

echo Sunset is at `l=12776844;curl -s http://weather.yahooapis.com/forecastrss?w=$l|grep astronomy| awk -F\" '{print $4}'`

This will get the sunrise and sunset times of a specific location. To be able to determine $l you need to first go to http://weather.yahoo.com/ and look up your location. The last numbers in the URL will be the $l