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
|
||||
errors.log
|
||||
own-rules.txt
|
||||
pre-adblock.txt
|
||||
.htaccess
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue