From a1cf9b97cebccade67ac9e219b489480bcef1e79 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Fri, 26 Mar 2021 00:53:47 +0100 Subject: [PATCH] #1888 kickstart cache file (#2109) --- build_sdcard.sh | 9 +++++++++ home.admin/config.scripts/network.monitor.sh | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build_sdcard.sh b/build_sdcard.sh index 1365948ac..efebe0985 100755 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -723,6 +723,15 @@ if [ "${baseImage}" = "raspbian" ]||[ "${baseImage}" = "raspios_arm64" ]||\ fi +# *** FALLBACK NODE LIST *** see https://github.com/rootzoll/raspiblitz/issues/1888 +echo "*** FALLBACK NODE LIST ***" +sudo -u admin curl -H "Accept: application/json; indent=4" https://bitnodes.io/api/v1/snapshots/latest/ -o /home/admin/fallback.nodes +byteSizeList=$(sudo -u admin stat -c %s /home/admin/fallback.nodes) +if [ ${#byteSizeList} -eq 0 ] || [ ${byteSizeList} -lt 1024 ]; then + echo "FAIL: downloading FALLBACK NODE LIST --> https://bitnodes.io/api/v1/snapshots/latest/" + exit 1 +fi + # *** FATPACK *** (can be activated by parameter - see details at start of script) if [ "${fatpack}" == "true" ]; then echo "*** FATPACK ***" diff --git a/home.admin/config.scripts/network.monitor.sh b/home.admin/config.scripts/network.monitor.sh index e71e2df3a..3df770e16 100755 --- a/home.admin/config.scripts/network.monitor.sh +++ b/home.admin/config.scripts/network.monitor.sh @@ -39,12 +39,13 @@ if [ "$1" = "peer-kickstart" ]; then # get raw node data from bitnodes.io (use Tor if available) #if [ "${runBehindTor}" == "on" ]; then - # call over tor proxy + # call over tor proxy (CAPTCHA BLOCKED) #bitnodesRawData=$(curl --socks5-hostname 127.0.0.1:9050 -H "Accept: application/json; indent=4" https://bitnodes.io/api/v1/snapshots/latest/ 2>/dev/null) #else # call over clearnet - bitnodesRawData=$(curl -H "Accept: application/json; indent=4" https://bitnodes.io/api/v1/snapshots/latest/ 2>/dev/null) + # bitnodesRawData=$(curl -H "Accept: application/json; indent=4" https://bitnodes.io/api/v1/snapshots/latest/ 2>/dev/null) #fi + bitnodesRawData=$(sudo -u admin cat /home/admin/fallback.nodes) if [ ${#bitnodesRawData} -lt 100 ]; then echo "error='no valid data from bitnodes.io'" exit 1