Feature: #3
This commit is contained in:
parent
25815fba2a
commit
677259ebdd
2 changed files with 9 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
all-adblock.txt
|
all-adblock.txt
|
||||||
|
errors.log
|
||||||
own-rules.txt
|
own-rules.txt
|
||||||
pre-adblock.txt
|
pre-adblock.txt
|
||||||
.htaccess
|
.htaccess
|
||||||
|
|
|
@ -1,19 +1,24 @@
|
||||||
#!/bin/bash
|
#!/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
|
#Adblock lists download
|
||||||
while read p; do
|
while read p; do
|
||||||
echo "#!MARKER- Begin of $p" >> pre-adblock.txt
|
echo "#!MARKER- Begin of $p" >> pre-adblock.txt
|
||||||
|
|
||||||
wget -qO - $p >> pre-adblock.txt
|
wget -qO - $p >> pre-adblock.txt
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "$date - Download failed: $p" >> errors.log
|
||||||
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done <adblocklists.txt
|
done <adblocklists.txt
|
||||||
|
|
||||||
# Breaking before will cause trouble if a URL is not reachable
|
# Breaking before will cause trouble if a URL is not reachable
|
||||||
set -e -u
|
set -e -u
|
||||||
|
|
||||||
date=$(date '+%a, %d %b %Y %H:%M:%S %z')
|
|
||||||
|
|
||||||
#Remove comments in lists
|
#Remove comments in lists
|
||||||
sed -i 's/^!.*$//g' pre-adblock.txt
|
sed -i 's/^!.*$//g' pre-adblock.txt
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue