mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
Robustness not needed anymore because of curl's --output, no more empty files
This commit is contained in:
parent
b0dbb1d1f6
commit
92d3560888
@ -11,7 +11,7 @@ getforecast() { curl -sf "$url/$LOCATION" --output "$weatherreport" && touch "$w
|
|||||||
|
|
||||||
# Forecast should be updated only once a day.
|
# Forecast should be updated only once a day.
|
||||||
checkforecast() {
|
checkforecast() {
|
||||||
[ -s "$weatherreport" ] && [ "$(stat -c %y "$weatherreport" 2>/dev/null |
|
[ "$(stat -c %y "$weatherreport" 2>/dev/null |
|
||||||
cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ]
|
cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
|
moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
|
||||||
|
|
||||||
[ -s "$moonfile" ] && [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
[ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
||||||
{ [ -z "$(pgrep 'sb-moonphase' | tail -n +3)" ] &&
|
{ [ -z "$(pgrep 'sb-moonphase' | tail -n +3)" ] &&
|
||||||
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
|
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
|
||||||
curl -sf "wttr.in/?format=%m" --output "$moonfile" && touch "$moonfile"; do sleep 60; done &&
|
curl -sf "wttr.in/?format=%m" --output "$moonfile" && touch "$moonfile"; do sleep 60; done &&
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user