Code:
run_ipv4_block () {
if [ -f /tmp/privacy-filter_ipv4_sorted.part ]; then rm /tmp/privacy-filter_ipv4_sorted.part; fi
if [ -z "$(which hostip)" ]; then
if [ -z "$(which /opt/bin/xargs)" ]
then cat $blocklist | xargs -n 5 -I {} sh -c "traceroute -4 {} | head -1 >> "/tmp/privacy-filter_ipv4_raw.part""
else cat $blocklist | /opt/bin/xargs -P 10 -n 5 -I {} sh -c "traceroute -4 {} | head -1 >> "/tmp/privacy-filter_ipv4_raw.part""; fi
cat /tmp/privacy-filter_ipv4_raw.part | grep -oE "$regexp_v4" >> /tmp/privacy-filter_ipv4_presort.part
else if [ -z "$(which /opt/bin/xargs)" ]
then cat $blocklist | xargs -n 5 -I {} sh -c "hostip {} >> "/tmp/privacy-filter_ipv4.prelist""
else cat $blocklist | /opt/bin/xargs -P 10 -n 5 -I {} sh -c "hostip {} >> "/tmp/privacy-filter_ipv4.prelist""; fi
fi
I think i found something wrong with xargs/traceroute arguments. If i execute
Code:
cat $blocklist | xargs -n 5 -I {} sh -c "traceroute -4 {} | head -1 >> "/tmp/privacy-filter_ipv4_raw.part""
I get the error:
'raceroute: bad address 'a.rad.msn.com
'raceroute: bad address 'a-0001.a-msedge.net
'raceroute: bad address 'a-0002.a-msedge.net
'raceroute: bad address 'a-0003.a-msedge.net
'raceroute: bad address 'a-0004.a-msedge.net
'raceroute: bad address 'a-0005.a-msedge.net
'raceroute: bad address 'a-0006.a-msedge.net
'raceroute: bad address 'a-0007.a-msedge.net
'raceroute: bad address 'a-0008.a-msedge.net
'raceroute: bad address 'a-0009.a-msedge.net
'raceroute: bad address 'ac3.msn.com
'raceroute: bad address 'aidps.atdmt.com
'raceroute: bad address 'aka-cdn-ns.adtech.de
'raceroute: bad address 'b.ads1.msn.com
'raceroute: bad address 'b.rad.msn.com
'raceroute: bad address 'bs.serving-sys.com
'raceroute: bad address 'c.atdmt.com
'raceroute: bad address 'c.msn.com
'raceroute: bad address 'choice.microsoft.com
'raceroute: bad address 'choice.microsoft.com.nsatc.net
If i do the same in my osx laptop i get good results.
To put it simple:
This
Code:
cat privacy-filter.list | xargs -n1 traceroute
does not work in the router but works in osx
I'm going to mess with the xargs params