From ae91fbcbbbdc6f04ec62bb11bb7c422e867f4e07 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 22 Aug 2022 12:22:03 +0200 Subject: update --- .local/bin/status/sb-forecast | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.local/bin/status/sb-forecast') diff --git a/.local/bin/status/sb-forecast b/.local/bin/status/sb-forecast index b022048..317b502 100755 --- a/.local/bin/status/sb-forecast +++ b/.local/bin/status/sb-forecast @@ -5,14 +5,14 @@ weatherglyph="/tmp/weatherglyph" moonglyph="/tmp/moonglyph" getweather() { - curl -sf "wttr.in/Lyon" >$weatherreport || exit 1 + curl -sf "wttr.in/Lyon" >$weatherreport || (rm -f $weatherreport && exit 1) curl -sf "wttr.in/Lyon?format=%c" >$weatherglyph || exit 1 curl -sf "wttr.in/?format=%m" >$moonglyph || exit 1 } [ -f $weatherreport ] && [ "$(gnustat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || getweather -printf "%s%s %s" \ +printf "%s%s %s" \ "$(cat $weatherglyph)" \ "$(cat $moonglyph)" \ "$(sed '16q;d' "$weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/ /g;1q" | tr -d '\n')" -- cgit v1.2.3