This commit is contained in:
Robin Kloppe 2023-07-27 17:56:51 +02:00
parent 25815fba2a
commit 677259ebdd
2 changed files with 9 additions and 3 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
all-adblock.txt
errors.log
own-rules.txt
pre-adblock.txt
.htaccess

View file

@ -1,19 +1,24 @@
#!/bin/bash
echo "" > pre-adblock.txt
touch pre-adblock.txt
touch errors.log
date=$(date '+%a, %d %b %Y %H:%M:%S %z')
#Adblock lists download
while read p; do
echo "#!MARKER- Begin of $p" >> pre-adblock.txt
wget -qO - $p >> pre-adblock.txt
if [ $? -ne 0 ]; then
echo "$date - Download failed: $p" >> errors.log
fi
sleep 2
done <adblocklists.txt
# Breaking before will cause trouble if a URL is not reachable
set -e -u
date=$(date '+%a, %d %b %Y %H:%M:%S %z')
#Remove comments in lists
sed -i 's/^!.*$//g' pre-adblock.txt