GNU Wget 1.16
Logging and input file:
-o, --output-file=FILE log messages to FILE.
wget -t 5 -o $dir/logs/download_hosts.log "$hosts" -O- |
wget -qO- "$hosts" |
That's probably the problem....the entware /opt directories are inserted in the path before the router /usr directories. So you are getting the Entware busybox wget instead of the updated router wget.But I do have entware-ng installed with busybox.
Ok, you have a newer version of BusyBox and therefore wget that does not support or use the -o option in a different way.
My output for wget --help is:
I use it to log the wget output to a file.Code:GNU Wget 1.16 Logging and input file: -o, --output-file=FILE log messages to FILE.
In the meantime, you can edit the first part of line 47 from:
to:Code:wget -t 5 -o $dir/logs/download_hosts.log "$hosts" -O- |
Thats just the code up to and including the first pipe (|).Code:wget -qO- "$hosts" |
If you have IPv6 enabled, replace the (different than line 47) code in line 50 too.
I don't post the complete line here because it would trigger cloudfare's protection.
I wonder if curl is the better way of doing this. They may have had their things sorted out long ago and don't change existing options on the fly.That's probably the problem....the entware /opt path is inserted in the path before the router /usr directories. So you are getting the Entware busybox wget instead of the router wget.
Sure. I'll sleep over it and see if anyone has more insights into that. I may then release a new version of update-hosts.shSo I can just edit the script and rerun?
Would that always point to the busybox wget? I kinda like the -o option for the logging feature. I have yet to find a good way of doing that with curl. The long line of code does not work with the | tee piping.Try editing the script and adding the full path to the router wget...
/usr/sbin/wget
No, the router wget was updated to the GNU wget. He installed Busybox under Entware, which get found before the router GNU wget.Would that always point to the busybox wget?
I need to check bashrcTry editing the script and adding the full path to the router wget...
/usr/sbin/wget
You may also want to think about using Entware Busybox (or only using applets not installed by the router).....If I remember correctly the router Busybox has some 'customizations' applied. There may be some incompatibilities with the Entware version.I need to check bashrc
I may have added entware at the beginning.
Since I use these hosts files a lot to test my builds, I have them all downloading regularly to an in house server.Reran the updated script and it installed with only adaway failing to download. I'll check the log after I redo my jffs start files.
Try editing the script and adding the full path to the router wget...
/usr/sbin/wget
I'm going to set the environment variable PATH in all the scripts to only look for the system binaries.could set variables etc if the paths change, makes less changing the whole script if something was to change
I'm going to set the environment variable PATH in all the scripts to only look for the system binaries.
These are what I use to program, they should suffice for the scripts to work properly.
I'm sure this works well in Asuswrt-Merlin. For forks of it, we'll have to see what happens.
And I might use your APP CHECK from your script. You have it easier in Pi-Hole, I believe.could set variables etc if the paths change, makes less changing the whole script if something was to change
I'll be inviting you as soon as they are ready. You'll be an early tester of the next version...I'll be glad to test it for you on my Netgear R7000
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!