redundanten Code entfernt
This commit is contained in:
parent
677259ebdd
commit
283c577b87
1 changed files with 13 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
touch pre-adblock.txt
|
echo '' > pre-adblock.txt
|
||||||
touch errors.log
|
touch errors.log
|
||||||
|
|
||||||
date=$(date '+%a, %d %b %Y %H:%M:%S %z')
|
date=$(date '+%a, %d %b %Y %H:%M:%S %z')
|
||||||
|
@ -19,22 +19,23 @@ 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
|
||||||
|
|
||||||
#Remove comments in lists
|
#Remove comments in lists and change marker to comment
|
||||||
sed -i 's/^!.*$//g' pre-adblock.txt
|
sed -i -e 's/^!.*$//g' -e 's/#!MARKER-/!MARKER-/g' pre-adblock.txt
|
||||||
|
|
||||||
#Change marker to comment
|
echo '' > all-adblock.txt
|
||||||
sed -i 's/#!MARKER-/!/g' pre-adblock.txt
|
|
||||||
|
|
||||||
|
{
|
||||||
#Create Header
|
#Create Header
|
||||||
echo '! Title: Mainboarder compiled
|
echo '! Title: Mainboarder compiled
|
||||||
! Description: Filters optimized for uBlock, for single list use, deduplicated
|
! Description: Filters optimized for uBlock, for single list use, deduplicated
|
||||||
! Expires: 2 days
|
! Expires: 2 days
|
||||||
! Last modified: '"$date"'
|
! Last modified: '"$date"'
|
||||||
! Homepage: https://git.mainboarder.de/Public/Adblocker
|
! Homepage: https://git.mainboarder.de/Public/Adblocker
|
||||||
!' > all-adblock.txt
|
!'
|
||||||
|
|
||||||
#Add own rules
|
#Add own rules
|
||||||
cat own-rules.txt >> all-adblock.txt
|
cat own-rules.txt
|
||||||
|
|
||||||
#Remove duplicate lines
|
#Remove duplicate lines
|
||||||
awk '!seen[$0]++' pre-adblock.txt >> all-adblock.txt
|
awk '!seen[$0]++' pre-adblock.txt
|
||||||
|
} >> all-adblock.txt
|
||||||
|
|
Loading…
Reference in a new issue