1
0
Fork 0

add retries to sb-forecast

This commit is contained in:
Luca Bilke 2023-04-21 15:02:38 +02:00
parent 641b4bd54a
commit 3d8434f394

View file

@ -10,8 +10,8 @@ weatheropts="?FA"
emojiopts="?FA&format=%c"
getforecast() {
curl -sf "$url$weatheropts" >"$weatherfile" || exit 1
curl -sf "$url$emojiopts" | sed 's/☀️//;s/☁️//;s/⛅️//;s/⛈//;s/✨//;s/❄️//;s/🌦//;s/🌧//;s/🌨//;s/🌩//;s/🌫//;' | cut -d ' ' -f 1 >"$emojifile" || exit 1
curl -sf --retry 5 "$url$weatheropts" >"$weatherfile" || exit 1
curl -sf "$url$emojiopts" --retry 5 | sed 's/☀️//;s/☁️//;s/⛅️//;s/⛈//;s/✨//;s/❄️//;s/🌦//;s/🌧//;s/🌨//;s/🌩//;s/🌫//;' | cut -d ' ' -f 1 >"$emojifile" || exit 1
}
fresh() {
[ -s "$weatherfile" ] && [ "$(stat -c %y "$weatherfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ]