From a7e76a81dcc590e123890d671734cb445c31cef6 Mon Sep 17 00:00:00 2001 From: qo-op Date: Tue, 18 May 2021 15:05:31 +0200 Subject: [PATCH] check connectivity with bootstrap before initialisation - and extend like connectivity --- ISOconfig.sh | 4 ++++ zen/gchange_INIT.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ISOconfig.sh b/ISOconfig.sh index ed5332b..d878e48 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -18,7 +18,11 @@ IPFSNODEID=$(ipfs id -f='\n') [ $(id -u) -eq 0 ] && echo "RUN as root FORBIDDEN. Please run with user: $YOU" && exit 1 rm -f /tmp/A_booting_log.txt +## TEST ROUTEUR PRESENCE ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo "CONNEXION OK" || exit 1 +## TEST BOOTSTRAP IP CONNECTIVITY +IPTEST=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | cut -d '/' -f 3 | shuf | head -n 1) +ping -q -w 1 -c 1 $IPTEST 2>&1>/dev/null && echo "CONNEXION OK" || echo "VERIFIER CONNEXION INTERNET" && exit 1 # GIT PULL astrXbian code mkdir -p ~/.zen/astrXbian && cd ~/.zen/astrXbian && git pull || exit 1 diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index accb129..658a943 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -110,7 +110,7 @@ IamBOOTSTRAP=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) # Contains ################## CHECKING WHO GAVE ME STARS -for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' && ~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | shuf) ); +for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' && ~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | shuf | head -n 1) ); do ##### BOOTSTRAP AUTO LIKE BACK (NOT liking Myself) if [[ "$IamBOOTSTRAP" == "$G1PUB" ]]; then