Joined: 04 Aug 2018 Posts: 1447 Location: Appalachian mountains, USA
Posted: Sun Sep 01, 2019 14:13 Post subject:
PavelVD wrote:
Thanks SurprisedItWorks! I like your improvement!
I allowed a slight improvement for myself
Yes, a nice adaptation!
When I cobble up these things for myself I sometimes forget, when I eventually post them, that people with different router setups are going to need to do things differently. My router reboots every night, and so reruns the script, at around the time yours runs the cron jobs, so in that way we are actually "on the same page" regarding updating the badhosts file. Your /jffs touch for continuity is of course ideal, but I don't use /jffs here and so am stuck with a minute (or less) of "vulnerability" to ads and malware in the middle of each night. _________________ 2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Fri Sep 06, 2019 19:39 Post subject:
hmmmm...to run my adblocker from custom script
i do have "sh /tmp/custom.sh" in start up...and than again i restart it via cron "0 12 * * * root /tmp/custom.sh" to get the updates...
i also noticed in DDWRT for some reason there is a limit number of those host's files list it never D/L all of them...for that reason i run only 1...
currently i do have this one running..
i guess in order to save space, it also does only 0.0.0.0 lines , those with 127.0.0.1 are not executed....so not much point to use that format...it needs revision i guess....
but i wouldn't mind to try this, jffs option...the only thing is, curl command is not present on few of my routers..so im limited to wget...
also there are many other adblocking scripts with or without whitelist/black list... _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Makes sense, except you seem to have a redundant extra (from the Department of Redundancy Department? ) grep in there. And you might want to replace "^0.0.0.0" with "^0\.0\.0\.0" (to be super careful bordering on paranoid sometimes, like me), since the unescaped version will match things like 0000000 or 010 020, etc. at the beginning of a line. (Not that there should ever be any of those to match!)
I'm curious... Do you find the loop sometimes goes around a time or two before it succeeds? It seems a mystery that these wgets and curls work except when they don't. _________________ 2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Sat Sep 07, 2019 2:30 Post subject:
SurprisedItWorks wrote:
I'm curious... Do you find the loop sometimes goes around a time or two before it succeeds? It seems a mystery that these wgets and curls work except when they don't.
nope i can see it ...cat/tmp/badhosts ... all there..
but yep sometimes is missing from syslog, but its fine
i thing is just a syslog issue
Thanks ill change those and see, and witch grep is not needed?? _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Joined: 04 Aug 2018 Posts: 1447 Location: Appalachian mountains, USA
Posted: Sat Sep 07, 2019 15:19 Post subject:
Alozaros wrote:
but yep sometimes is missing from syslog, but its fine
i thing is just a syslog issue
Neither of us has anything in our scripts that would cause syslog to be written. If I wanted to print my little badhosts.errcodes file into the syslog, I believe I could add something like this to my script at or near the end:
Here the quotes contain a text tag that would go into the syslog entry to label it. Haven't tested this, so experimenting from the CLI would be appropriate.
Quote:
Thanks ill change those and see, and witch grep is not needed?
Either of the first two, as they select the same lines in the data. Need to keep the filename there, of course, so the easiest is to eliminate the second one:
That's the fun of Unix text processing... there are always many ways to do things! _________________ 2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Joined: 04 Aug 2018 Posts: 1447 Location: Appalachian mountains, USA
Posted: Sun Sep 08, 2019 23:08 Post subject:
Hi folks...
Turns out I had a bug in my adblocking code above. Corrected and generally improved version in my Sunday Sep 8, 2019 (today) post at https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1176075. We've had these two threads going on one common topic for awhile. Time to join forces? _________________ 2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.