Hi 05dyna, you mean you installed pi-hole on the router?...
Can you elaborate on this?
I'm using a simple hosts file on each DT at home, but considering the broader and better approach of scripts on my router (over 500 MB RAM WRT3200ACM) with dnsmasq, or pi-hole?...
Which one is less of hassle?...
Thanks a lot for any heads up.
Ost _________________ DD-WRT V3.0-r49626 std (08/03/22) on WRT3200ACM and flying...
Posted: Fri Jan 19, 2024 18:57 Post subject: One line script
One line script
1. Waits for internet connection. 2. Downloads host file. 3. Restarts DNSMasq (loads hosts)
(Replace "/jffs/hosts" with your own custom path and the host file server if you want)
Add to ADMINISTRATION / Commands / Startup
Code:
until [ `nvram get wan_ipaddr` != 0.0.0.0 ]; do sleep 1; done; wget -O /jffs/hosts http://sbc.io/hosts/hosts; killall -HUP dnsmasq
Also add to SERVICES / Services / DNSMasq / Additional DNSMasq Options
Code:
addn-hosts=/jffs/hosts
Last edited by Veole on Sat Jan 20, 2024 17:35; edited 4 times in total
Both wget and curl work fine with https. wget can't verify https certificates like curl but downloads files the same. I tested both and decided to post the one line script with wget because I think curl is not included in busybox by default, but wget is always present.
I have no idea why you would say that.
The integrated wget busybox version does not support ssl
Because I've tested both wget and curl and I'm currently using wget. It works. I always deleted the host file before testing, just in case.
Code:
root@router:/jffs# until [ `nvram get wan_ipaddr` != 0.0.0.0 ]; do sleep 1; done
; busybox wget -O /jffs/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master
/hosts; killall -HUP dnsmasq
Connecting to raw.githubusercontent.com (185.199.109.133:443)
wget: note: TLS certificate validation not implemented
saving to '/jffs/hosts'
hosts 100% |********************************| 4576k 0:00:00 ETA
'/jffs/hosts' saved
Code:
root@router:/jffs# until [ `nvram get wan_ipaddr` != 0.0.0.0 ]; do sleep 1; done
; curl -o /jffs/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master
/hosts; killall -HUP dnsmasq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4576k 100 4576k 0 0 364k 0 0:00:12 0:00:12 --:--:-- 355k
It seems wget functionality was removed in newer ddwrt builds. But why?
I even tested it in busybox Windows and it works like curl (without any connection error or TLS certificate validation error).
600K exe -> https://frippery.org/files/busybox/busybox.exe
Code:
C:/ $ wget https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
Connecting to raw.githubusercontent.com (185.199.110.133:443)
saving to 'hosts'
hosts 100% |***************************************************************************************************************| 4576k 0:00:00 ETA 'hosts' saved
GNU Wget is a free software package for retrieving files using HTTP, HTTPS, FTP and FTPS, the most widely used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.
Busybox wget has never had https/ssl functionality in DD-WRT, or hasn't for a long time. _________________ "The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost
"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio