From 4fad876f66773cc6b30066738ad53fda45dcd161 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 31 Dec 2023 00:35:30 +0100 Subject: [PATCH] introduced & remove bug --- RUNTIME/UPLANET.refresh.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/RUNTIME/UPLANET.refresh.sh b/RUNTIME/UPLANET.refresh.sh index b83e0d32a..08d4df0d8 100755 --- a/RUNTIME/UPLANET.refresh.sh +++ b/RUNTIME/UPLANET.refresh.sh @@ -240,12 +240,13 @@ echo "" > ~/.z #################################### ## RECORD P4N SPOT DATA echo "P4N : https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr" - [[ -s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ]] \ - && curl -s "https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr" -o ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json \\ + [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json ]] && echo "" > ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json + [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ]] \ + && curl -s "https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr" -o ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json \ && [[ $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json) -gt $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json) ]] \ && mv ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json \ - && echo "UPDATED" \ - || echo "NO CHANGE" + && echo "UPDATED PARK4NIGHT" \ + || rm ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json #################################### echo "GET GCHANGE ADS..."