thelonelycoder
Part of the Furniture
I don't know how good you are with scripts, but this is roughly what Diversion does. Edit as needed.@thelonelycoder
Thanks for the link. The information there is exactly what I was looking for.
My old one is about 865 kb, then I guess I use the standard list.
With this Information I can then almost create the list by myself...
Is there a trick how I can convert the list so that several addresses are in one row ?
like this ->
192.168.123.60 diversion-adblocking-ip.address 0.nextyourcontent.com 0.r.msn.com 000.0x1f4b0.com 000.gaysexe.free.fr 000free.us
And with that we are back to the copy/paste age of Adblocking with a combined hosts file
Code:
# pixelserv-tls IP
blockingIP=192.168.123.60
# Must not be over 25!
domainsPerLine=20
# Hosts file raw URL
hostsFile=https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
# Full path including filename to blocking list
blockinglist=/tmp/mnt/8GB/blockinglist
# Do not change below
curl_dl(){ curl --insecure --location --connect-timeout 10 --retry 3 -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0" --progress-bar "$@";}
curl_dl "$hostsFile" | grep "^[^#]" \
| sed -e "s/^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/X/g" \
| grep -w "^X" | awk '{print " "$2}' | grep -E '[[:alnum:]]+[.][[:alnum:]_.-]+' \
| awk '!/ [0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$/' | awk '!/[:?\/;]/' \
| awk '{if(NR%'"$domainsPerLine"'==0){a=a""$0;print b a" "; a=""}else a=a""$0}END{if(a)print b a" "}' b="$blockingIP" \
> "${blockinglist}"