add retries to sb-forecast
This commit is contained in:
parent
641b4bd54a
commit
3d8434f394
1 changed files with 2 additions and 2 deletions
|
@ -10,8 +10,8 @@ weatheropts="?FA"
|
||||||
emojiopts="?FA&format=%c"
|
emojiopts="?FA&format=%c"
|
||||||
|
|
||||||
getforecast() {
|
getforecast() {
|
||||||
curl -sf "$url$weatheropts" >"$weatherfile" || exit 1
|
curl -sf --retry 5 "$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 "$url$emojiopts" --retry 5 | sed 's/☀️//;s/☁️//;s/⛅️//;s/⛈//;s/✨//;s/❄️//;s/🌦//;s/🌧//;s/🌨//;s/🌩//;s/🌫//;' | cut -d ' ' -f 1 >"$emojifile" || exit 1
|
||||||
}
|
}
|
||||||
fresh() {
|
fresh() {
|
||||||
[ -s "$weatherfile" ] && [ "$(stat -c %y "$weatherfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ]
|
[ -s "$weatherfile" ] && [ "$(stat -c %y "$weatherfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue