#!/bin/sh # # No limits for prunednode.today, worldwide fast. # Courtesy of CloudFlare Pages (now free of IPFS, # at least for us on this level) # # This is a shell script which downloads all the files # one by one and joins them to the original latest.zip # for which Stepan's signature of checksum is made. # # For a more advanced example which is decompressing # the ZIP file on the fly using bsdtar which comes from # libarchive-tools, see bsdtar.sh.txt and note that # no signature or checksum verification is being done # there as it all extracts on the fly and does not leave # a file to verify. Use bitcoin-cli gettxoutsetinfo muhash # while having coinstatsindex enabled (the results differ) # to check these data are valid. BTW it would not make # sense to distribute anything alsa but valid Bitcoin data. # # Requirements: wget, cat, rm, sha256sum, grep, ln, gpgv # # Demo: https://asciinema.org/a/532820 URL=https://lin.anyone.eu.org # Some functions # # getparts downloads parts and assembles # the latest.zip from them getparts() { test -r files.txt || wget -q $URL/files.txt LINES=$(wc -l files.txt | grep -Eo '[0-9]+') N=0 while read file do N=$((N+1)) echo "Processing file $file... ($((100*$N/$LINES))%)" wget -qO - $URL/$file >> latest.zip done < files.txt } test -w latest.zip && { echo "The file latest.zip already exists." printf "Would you like to overwrite it? [y/N]: " read answer ! test "$answer" = "y" -o "$answer" = "Y" || { > latest.zip false } } || getparts ls latest.zip || exit 1