improve blocklist generation script
This commit is contained in:
parent
9dca8f1a89
commit
006603de0f
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
function import_hosts() {
|
function import_hosts() {
|
||||||
local url=$1
|
local url=$1
|
||||||
curl "$url" | sed '/^#/d' | sed 's/0.0.0.0 //g' | sed 's/127.0.0.1 //g' | grep '\S'
|
# Trim lines, remove comments, convert tabs to spaces, collapse multiple spaces, and
|
||||||
|
# take the second column of the output
|
||||||
|
curl "$url"| sed -E 's/^[ \t]+//g' | sed '/^#/d' | sed 's/\t/ /g' | sed -E 's/[ ]+/ /g' | cut -d ' ' -f 2 | grep '\S'
|
||||||
}
|
}
|
||||||
|
|
||||||
# In blocklist_config, put a list of URLs to shared ad-blocking hosts files
|
# In blocklist_config, put a list of URLs to shared ad-blocking hosts files
|
||||||
|
|
Loading…
Reference in New Issue