Local startup downloading a hosts file on reboot fails

I have used a typical script on my openwrt startup, downloading a hosts file as such:
wget https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts -O /etc/hosts

The above command is placed on "Local startup" tab of "Startup" section in LuCI. It states:
This is the content of /etc/rc.local.

It WAS working a few days ago, but I have since been implementing some DNS filtering, by installing https-dns-proxy. Now, it cannot resolve the host raw.githubusercontent.com when the above script is executed during boot. Manual execution of the command works perfectly.

excerpt from logread

Sat Aug 12 14:40:33 2023 daemon.notice procd: /etc/rc.d/S95done: Downloading 'https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts'
Sat Aug 12 14:40:38 2023 daemon.notice procd: /etc/rc.d/S95done: Failed to send request: Operation not permitted

curl doesn't work either:
curl: (6) Could not resolve host: raw.githubusercontent.com

What gives? Why is it not resolving during boot?

Race condition?

Especially if you route the routers own dns requests via the DoH proxy too.

Try adding a sleep 30 before the wget.

Man, I love you

It's not that I hadn't thought of it before. I had sleep 10 && wget [...] which didn't solve the issue, along with MORE commands with their respective sleeps BEFORE the wget.
Adding the sleep 30 solved the issue. Now, reducing it to previous values of sleep 10 WORKS. So I will just make sure to sleep plenty when troubleshooting

Well established helper packages like luci-app-adblock and its alternatives usually have these issues sorted, it makes sense to rely on those and to just add your desired blocklists.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.