From 2a4eeb914af7d9a5134a9612cf90f6978055a790 Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 20 Sep 2021 23:50:53 +0200 Subject: [PATCH] This spot.json is managed by $geosrc --- actions/p4n.swarmscraper.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/actions/p4n.swarmscraper.sh b/actions/p4n.swarmscraper.sh index f221128..b6bafce 100755 --- a/actions/p4n.swarmscraper.sh +++ b/actions/p4n.swarmscraper.sh @@ -88,11 +88,13 @@ fi ##############################################################" ## GEODATA. continue. Let's extract lieu pdf from my spot ##############################################################" -geodata=$(ls ~/.zen/{ipfs,ipfs_swarm}/.*/astroport/map/$lat.$lon/p4n/spot.json 2>/dev/null | tail -n 1) +geosrc=$(ls ~/.zen/{ipfs,ipfs_swarm}/.*/astroport/map/$lat.$lon/p4n/spot.json 2>/dev/null) +geodata=$(echo "$geosrc" | tail -n 1) ipfsnodeid=$(echo "$geodata" | cut -d '/' -f 6 | cut -d '.' -f 2) if [[ "$ipfsnodeid" != "$IPFSNODEID" ]]; then - echo "This spot.json is already managed by $ipfsnodeid" + echo "This spot.json is managed by + $geosrc" echo "getting geodata from one of mine" geodata=$(ls ~/.zen/ipfs/.*/astroport/map/*.*/p4n/spot.json | shuf | tail -n 1) fi