From 7e15ebab95aed6954b2dc8102972393b8d342056 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 4 Oct 2022 19:47:15 +0200 Subject: [PATCH] Get TW from Bootstrap Gateway if no ipfs is running --- tools/VISA.new.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/VISA.new.sh b/tools/VISA.new.sh index 782d90b2..a6a13271 100755 --- a/tools/VISA.new.sh +++ b/tools/VISA.new.sh @@ -26,7 +26,12 @@ if [[ $SALT != "" && PEPPER != "" ]]; then mkdir -p ~/.zen/tmp/TW rm -f ~/.zen/tmp/TW/index.html - ipfs --timeout 6s cat /ipns/$GNS > ~/.zen/tmp/TW/index.html + + YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); + LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2) + echo "$LIBRA/ipns/$voeuns" + [[ $YOU ]] && ipfs --timeout 12s cat /ipns/$GNS > ~/.zen/tmp/TW/index.html \ + || curl -so ~/.zen/tmp/TW/index.html "$LIBRA/ipns/$GNS" if [ ! -s ~/.zen/tmp/TW/index.html ]; then rm -f ~/.zen/tmp/TW/index.html