Fixes failure when disconnected or on broken network.
else
# get daylight times at most once a day
if [ ! -e "$DATA" ] || [ $(( `date +%s` - `stat -c %Y $DATA` )) -gt 86400 ]; then
- curl --silent --show-error -o "$DATA" 'https://api.sunrise-sunset.org/json?lat=48.22&lng=10.54&formatted=0'
+ curl --silent --show-error --connect-timeout=5 -o "$DATA" 'https://api.sunrise-sunset.org/json?lat=48.22&lng=10.54&formatted=0' || true
fi
sunrise=$(jq -r .results.sunrise < ~/.cache/sunrise.json)
sunset=$(jq -r .results.sunset < ~/.cache/sunrise.json)