--timeout=60s

This commit is contained in:
qo-op 2021-06-04 22:37:43 +02:00
parent cf7d342a8a
commit 82e463d4aa
1 changed files with 4 additions and 3 deletions

View File

@ -4,16 +4,17 @@ MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
########################################################################
export IPFSNODEID=$(ipfs id -f='<id>\n')
IPFSNODEID=$(ipfs --timeout=5s id -f='<id>\n')
[[ $IPFSNODEID == "" ]] && echo "ipfs TIMEOUT" && exit 1
########################################################################
echo "PUBLISHING ~/.zen/ipfs SELF http://127.0.0.1:8181/ipns/$IPFSNODEID"
MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
MIPFS=$(ipfs --timeout=60s add -rHq ~/.zen/ipfs | tail -n 1)
OLDCHAIN=$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)
if [[ "$OLDCHAIN" != "$MIPFS" ]] # MODIFY CHAIN only if something was changed
then
echo "$(date -u +%s%N | cut -b1-13)" > ~/.zen/ipfs/.${IPFSNODEID}/.timestamp
echo $MIPFS > ~/.zen/ipfs/.${IPFSNODEID}/.chain
NODEIPNS=$(ipfs name publish --quieter /ipfs/$MIPFS)
NODEIPNS=$(ipfs --timeout=60s name publish --quieter /ipfs/$MIPFS)
fi
########################################################################