Page 33 of 33

Re: Adblock Plugin

Posted: Mon Aug 08, 2022 5:09 am
by pythonic
On at least some devices, the adblock lists don't seem to get updated as expected. I think this comes down to a path issue in the adblock cron entry.

The standard crontab entry set by /usr/lib/adblock/runadblock.sh is:

Code: Select all

0 4 * * 0 sh /plugin_root/usr/lib/adblock/runadblock.sh
However on affected devices the runadblock.sh script doesn't exist on that path in which case I think the cron entry should look like:

Code: Select all

0 4 * * 0 sh /usr/lib/adblock/runadblock.sh
If you're using the adblock plugin and the lists don't appear to be getting updated every Sunday, you can make the change at line 18 in /usr/lib/adblock/runadblock.sh from

Code: Select all

CRON="0 4 * * 0 sh /plugin_root/usr/lib/adblock/runadblock.sh"
to

Code: Select all

CRON="0 4 * * 0 sh /usr/lib/adblock/runadblock.sh"
and then disable then re-enable the plugin. You can also make a temporary change to the cron entry itself with an ssh connection and the command

Code: Select all

crontab -e
but be warned that it requires knowing how to use the vi text editor (unless you've made other arrangements)...

Re: Adblock Plugin

Posted: Mon Aug 08, 2022 8:10 am
by Lantis
Would that be a device which has had adblock installed as a default package?

Re: Adblock Plugin

Posted: Tue Aug 09, 2022 5:06 am
by pythonic
In the examples I've looked at, yes.

Re: Adblock Plugin

Posted: Tue Aug 09, 2022 7:48 am
by Lantis
Yea, i did a bang up job on that one (being my first plugin). It only works if it's installed as a plugin, and only if you don't use extroot. What a mess.
Needs a rewrite honestly :(

Re: Adblock Plugin

Posted: Wed Aug 10, 2022 5:14 am
by pythonic
While a re-write may well be warranted, I wouldn't be too harsh on yourself ;) as it seems to work ok within it's limitations and I don't think many have hit either the pre-installed or ext_root related problems.

If you want to check any of the other plugins that aren't usually built into official images, a "kitchen sink" image on a platform that doesn't usually have space restrictions might be handy for testing for such bugs - x86/amd64 would be one where this might be useful and my RPi builds are like this.

Re: Adblock Plugin

Posted: Fri Jan 20, 2023 2:16 pm
by aioyups
To be honest I actually prefer your adblock plugin than those provided by openwrt to the poin that I copy the script from my gargoyle device, edit some script and put it in my other openwrt based device.
The reason is because the script file is so small and it didn't eat ram space after running because it didn't run as a service. The cron just run it every specific time and be done. As for the other function actually it's never used by me.

The thing that I think necesarry is the ability to download from any other file source format like abp, dnsmasq, domain, and hosts. That is what I edit in mine.