thelonelycoder
Part of the Furniture
This is likely the last version (exept bug fixes, under the same version number) to come out.should i upgrade to 1.06 or stay at 1.05?
It's up to you, if you have no use of the new functions then stay on 1.05.
This is likely the last version (exept bug fixes, under the same version number) to come out.should i upgrade to 1.06 or stay at 1.05?
I see why it happened, the shell type/version on Asuswrt-Merlin is not as capable as I thought.Hi Lonely, I upgraded both 1.05 and 1.06 today, and the only problem I got was about the services-start script deleted on my /jffs partition. [/CODE]
Post your update file here, so I can check it.I upgraded to 1.06 and I used "sh" - Sort hosts.
After it finished I observed that in my case the file "hosts-adblock" has ~half of the size after sorting.
It is ok? Maybe it is removing some duplicates during sort?
I have to mention that in the "update-hosts.sh" I added some more hosts lists.
This file is full of duplicates (as in it's full of stars...). Hang on...The added part below...
When I updated I had ~24MB and after sort the file arrived at ~12MB
I tried to obtain a merge between option 3 and 4 of host file type + few others.
wget -qO- \
"http://winhelp2002.mvps.org/hosts.txt" \
"http://someonewhocares.org/hosts/zero/hosts" \
"http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&startdate[day]=&startdate[month]=&startdate[year]=&mimetype=plaintext&useip=0.0.0.0" \
"http://www.malwaredomainlist.com/hostslist/hosts.txt" \
"http://support.it-mate.co.uk/downloads/hosts.txt" \
"http://hosts-file.net/hphosts-partial.txt" \
"http://www.hosts-file.net/emd.txt" \
"http://hosts-file.net/grm.txt" \
"http://hosts-file.net/mmt.txt" \
"http://hosts-file.net/ad_servers.txt" \
"http://adaway.org/hosts.txt" \
"http://hosts-file.net/exp.txt" \
"http://hosts-file.net/fsa.txt" \
"http://hosts-file.net/hfs.txt" \
"http://hosts-file.net/hjk.txt" \
"http://hosts-file.net/pha.txt" \
"http://hosts-file.net/psh.txt" \
> $dir/temp1
The sort uses the -u option to remove duplicates.Maybe the sort is done only for the original list from original installation with 6 hosts, ignoring the lists added by me. I saw that option 4 has ~ 12MB.
I know that, still the update-hosts.sh should take care of the dups.The sort uses the -u option to remove duplicates.
This version did not have a sort function. I may be onto something here.Maybe it helps... on version 1.05 with the same list I had ~24MB
sed $'s/\r$//'
cat $dir/temp1 | sed s/127.0.0.1/0.0.0.0/g | sed $'s/\r$//' | grep -w ^0.0.0.0 | awk '{print $1 " " $2}' > $dir/temp2
cat $dir/temp1 | sed s/127.0.0.1/0.0.0.0/g | grep -w ^0.0.0.0 | awk '{print $1 " " $2}' | sort -u > $dir/temp2
I've had this code running on my routers for close to a year without realising it never removed the duplicates.Just checked in Excel before seeing your answer, and yes a lot of duplicates were there after update hosts.
I'm trying now with your new recommendation.
It seems that is already sorted after "update hosts", probably because of "| sort -u > $dir/temp2" from new line.
I thing that is much better now to have it already sorted. It doesn't take much time on my router.
Thx
I thought it was there to guard against importing a dos formatted text file, to convert return/newline to newline.What's that sed command doing again?
Grabs and replaces it with nothing, but what is it really doing?Code:sed $'s/\r$//'
Sorry.I know that, still the update-hosts.sh should take care of the dups.
I thought it was there to guard against importing a dos formatted text file, to convert return/newline to newline.

Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!