Fix loop for sxmo_weather.sh
This commit is contained in:
parent
57f6e5897e
commit
f25bb821ba
1 changed files with 6 additions and 4 deletions
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
[ -z "$SXMO_GPSLOCATIONSFILES" ] && SXMO_GPSLOCATIONSFILES="/usr/share/sxmo/places_for_gps.tsv"
|
[ -z "$SXMO_GPSLOCATIONSFILES" ] && SXMO_GPSLOCATIONSFILES="/usr/share/sxmo/places_for_gps.tsv"
|
||||||
NHOURS=72
|
|
||||||
ROWHOURS=12
|
ROWHOURS=12
|
||||||
WEATHERXML=""
|
WEATHERXML=""
|
||||||
|
|
||||||
|
@ -67,6 +66,7 @@ printtables() {
|
||||||
ROWHOURS="$(echo "$ROWHOURS - $INDENTN" | bc)"
|
ROWHOURS="$(echo "$ROWHOURS - $INDENTN" | bc)"
|
||||||
|
|
||||||
LASTDAY=""
|
LASTDAY=""
|
||||||
|
NHOURS=72
|
||||||
# E.g. each while loop iteration handles 1 row
|
# E.g. each while loop iteration handles 1 row
|
||||||
while echo "$TIME" | grep -Eq "[0-9]+" && [ "$NHOURS" -gt 0 ]; do
|
while echo "$TIME" | grep -Eq "[0-9]+" && [ "$NHOURS" -gt 0 ]; do
|
||||||
if [ "$LASTDAY" != "$NOWDAY" ]; then
|
if [ "$LASTDAY" != "$NOWDAY" ]; then
|
||||||
|
@ -95,10 +95,12 @@ printtables() {
|
||||||
}
|
}
|
||||||
|
|
||||||
getweathertexttable() {
|
getweathertexttable() {
|
||||||
|
LAT="$1"
|
||||||
|
LON="$2"
|
||||||
|
PLACE="$3"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
LAT="$1"
|
clear
|
||||||
LON="$2"
|
|
||||||
PLACE="$3"
|
|
||||||
downloadweatherxml "$LAT" "$LON" 2>/dev/null
|
downloadweatherxml "$LAT" "$LON" 2>/dev/null
|
||||||
TEMP="$(weatherdata "//temperature" "hourly")"
|
TEMP="$(weatherdata "//temperature" "hourly")"
|
||||||
RAIN="$(weatherdata "//probability-of-precipitation" ".")"
|
RAIN="$(weatherdata "//probability-of-precipitation" ".")"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue