diff options
Diffstat (limited to 'ar')
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-forecast | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ar/.local/bin/statusbar/sb-forecast b/ar/.local/bin/statusbar/sb-forecast index 3039abb..9c5c7aa 100755 --- a/ar/.local/bin/statusbar/sb-forecast +++ b/ar/.local/bin/statusbar/sb-forecast @@ -30,8 +30,9 @@ getweatherreport() { } getweatherreportjson() { - timeout --signal=1 10s curl -sf "$url/$location?format=j1" >"$weatherreportjson" || - error "reportjson" + tmp=$(timeout --signal=1 10s curl -sf "$url/$location?format=j1") || error "reportjson" + echo "$tmp" | jq -e '.data.weather' >/dev/null 2>&1 || error "reportjson" + echo "$tmp" >"$weatherreportjson" } # Forecast should be updated every 3 hours, but set 86400 to check once a day for reliability. |
