yayponies-ipfs/yayponies-update.sh

24 lines
677 B
Bash
Raw Normal View History

2019-04-22 00:26:11 +02:00
#!/bin/bash
2019-04-22 13:06:38 +02:00
cd $1
git pull origin master
cd ypmirror
2019-04-22 00:26:11 +02:00
git reset --hard
git pull origin master
for f in $(find . -type f -name '*.php'); do
2019-04-22 13:27:03 +02:00
curl "$2/$f" -so "${f/php/html}"
2019-04-22 00:26:11 +02:00
done
2019-04-22 13:27:03 +02:00
find . -type f -name '*.php' -exec rm {} +
2019-04-22 13:06:38 +02:00
find . -type f -exec sed 's/\.php/\.html/g' -i {} +
2019-04-22 00:26:11 +02:00
cd ..
hash=$(ipfs name publish /ipfs/$(ipfs add -r ypmirror/ | sed '/ ypmirror$/!d;s/added //;s/ .*//g') | sed 's/:.*//g;s/Published to //g')
2019-04-22 13:00:10 +02:00
echo "
Create a DNS TXT record with value dnslink=/ipfs/$hash and name _dnslink.domain.name (add a TXT record with name domain.name, too, just to be sure).
2019-04-22 00:26:11 +02:00
Then configure it using https://www.cloudflare.com/distributed-web-gateway
Enjoy!
~Daniil Gentili"