28 lines
671 B
Bash
Executable file
28 lines
671 B
Bash
Executable file
#!/bin/bash
|
|
set -e -u
|
|
|
|
#Adblock Listen herunterladen
|
|
while read p; do
|
|
wget -qO - $p >> all-adblock.txt
|
|
done <adblocklists.txt
|
|
|
|
date=$(date '+%a, %d %b %Y %H:%M:%S %z')
|
|
|
|
#Kommentare in den Listen löschen
|
|
sed 's/^!.*$//g' all-adblock.txt > allfilters.txt
|
|
|
|
#Header erstellen
|
|
echo '! Title: Mainboarder kompiliert
|
|
! Description: Filters optimized for uBlock, for single list use, deduplicated
|
|
! Expires: 2 days
|
|
! Last modified: '"$date"'
|
|
! Homepage: https://git.mainboarder.de/Public/Adblocker
|
|
!' > all-adblock.txt
|
|
|
|
#Eigene Regeln hinzufügen
|
|
cat own-rules.txt >> all-adblock.txt
|
|
|
|
#Duplikate entfernen
|
|
awk '!seen[$0]++' allfilters.txt >> all-adblock.txt
|
|
rm allfilters.txt
|