From db0ca70a63c1ce6d5e30a6ccda36c4deb29b9ae0 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 6 Aug 2021 15:52:07 +0200 Subject: [PATCH] No timeout on "ipfs add" before publish, or get rubbish --- zen/ipns_TAG_refresh.sh | 5 +++-- zen/ipns_self_publish.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/zen/ipns_TAG_refresh.sh b/zen/ipns_TAG_refresh.sh index 9e2dd2b..cd1e724 100755 --- a/zen/ipns_TAG_refresh.sh +++ b/zen/ipns_TAG_refresh.sh @@ -250,12 +250,13 @@ for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK); do ## GET ACTUAL IPNS .chain VALUE mkdir -p /tmp/${mediakey} echo "${mediakey} GET IPNS" - ipfs --timeout 20s get -o /tmp/${mediakey} /ipns/$ipnsid + ipfs get -o /tmp/${mediakey} /ipns/$ipnsid + [ $? -ne 0 ] && continue echo "ADD TO IPFS" NEWIPFS=$(ipfs add -rHq /tmp/${mediakey}/ | tail -n 1) ## PUBLISH IT - ipfs --timeout 60s name publish -k ${mediakey} --quieter /ipfs/$NEWIPFS + ipfs name publish -k ${mediakey} --quieter /ipfs/$NEWIPFS echo "ECHO PUBLISHING https://tube.copylaradio.com/ipns/$ipnsid TO /ipfs/$NEWIPFS" done diff --git a/zen/ipns_self_publish.sh b/zen/ipns_self_publish.sh index e4bdf58..6c3003b 100755 --- a/zen/ipns_self_publish.sh +++ b/zen/ipns_self_publish.sh @@ -12,7 +12,7 @@ IPFSNODEID=$(ipfs --timeout=30s id -f='\n') ######################################################################## echo "PUBLISHING ~/.zen/ipfs SELF http://127.0.0.1:8181/ipns/$IPFSNODEID" -MIPFS=$(ipfs --timeout=180s add -rHq ~/.zen/ipfs | tail -n 1) +MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1) OLDCHAIN=$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain) if [[ "$OLDCHAIN" != "$MIPFS" ]] # MODIFY CHAIN only if something was changed then