I have tried using all awk for the script before, but I find piping the grep output into awk to be 2-3x faster on the Edgerouter Lite. I just ran some timed tests for your script against mine on the ErLite, and I got similar results, with my script completing in ~6 seconds against the StevenBlack hosts file, and yours at ~14 seconds. This may not be the case on more conventional architectures. I am considering rewriting the script in Perl to see if that runs any faster.

On 12/30/17 00:21, Freddy DISSAUX wrote:
Hi everyone,
Hello,

[ snip ]

cat hosts | grep '^0\.0\.0\.0' | awk '{print "local-zone: \""$2"\" redirect\nlocal-data: 
\""$2" A 0.0.0.0\""}' > ads.conf
awk 'NF == 2 && $1 == "0.0.0.0" && $2 ~ /^[a-z0-9]/ { print "local-zone: \"" $2 "\" redirect\nlocal-data: 
\"" $2 " A " $1 "\"" }' host > ads.conf


Regards,


Reply via email to