#1888 kickstart cache file (#2109)

This commit is contained in:
/rootzoll 2021-03-26 00:53:47 +01:00 committed by GitHub
parent 2d28aa0752
commit a1cf9b97ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -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 ***"

View File

@ -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