From f25bb821baef8fb61d5a4d33d67663a0f6c36e15 Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Thu, 9 Jul 2020 18:29:56 -0500 Subject: [PATCH] Fix loop for sxmo_weather.sh --- scripts/appscripts/sxmo_weather.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/appscripts/sxmo_weather.sh b/scripts/appscripts/sxmo_weather.sh index 04420e8..d107506 100755 --- a/scripts/appscripts/sxmo_weather.sh +++ b/scripts/appscripts/sxmo_weather.sh @@ -1,6 +1,5 @@ #!/usr/bin/env sh [ -z "$SXMO_GPSLOCATIONSFILES" ] && SXMO_GPSLOCATIONSFILES="/usr/share/sxmo/places_for_gps.tsv" -NHOURS=72 ROWHOURS=12 WEATHERXML="" @@ -67,6 +66,7 @@ printtables() { ROWHOURS="$(echo "$ROWHOURS - $INDENTN" | bc)" LASTDAY="" + NHOURS=72 # E.g. each while loop iteration handles 1 row while echo "$TIME" | grep -Eq "[0-9]+" && [ "$NHOURS" -gt 0 ]; do if [ "$LASTDAY" != "$NOWDAY" ]; then @@ -95,10 +95,12 @@ printtables() { } getweathertexttable() { + LAT="$1" + LON="$2" + PLACE="$3" + while true; do - LAT="$1" - LON="$2" - PLACE="$3" + clear downloadweatherxml "$LAT" "$LON" 2>/dev/null TEMP="$(weatherdata "//temperature" "hourly")" RAIN="$(weatherdata "//probability-of-precipitation" ".")"