Re: Where can I add a script

Dave Evans <[email protected]>
Newsgroups gmane.comp.security.ipcop.user
Organization House of Goodness
Message-ID <[email protected]>
On 01/08/2015 16:24, Koko Wijatmoko wrote:
> On Sat, 1 Aug 2015 10:41:23 -0400
> Renaud (Ron) OLGIATI <renaud-9qJ39Kf4vhh95CE/QLhGvQK61p16E/[email protected]> wrote:
>
>> For years I have been blocking adds on my LAN using on my IPCop box
>> an extended /etc/hosts file, which holds around 250.000 lines like
>> 127.0.0.7 www.doubleclick.com
>>
>> Up to now this was done by running a cron job evey ten minutes, which
>> launches a script:
>>
>> #!/bin/bash
>> # Append my blacklist of hosts from /var/tmp/badhosts to /etc/hosts
>> # if hosts.cgi has been run to update /var/ipcop/main/hosts.
>> if [[ ! /var/ipcop/main/hosts -ot /etc/hosts ]]
>> then
>>          cat /var/tmp/badhosts >> /etc/hosts
>>          /usr/bin/killall -s HUP dnsmasq
>> fi
>>
> why you "kill" it? send SIGHUP signal to running
> dnsmasq, it will re-read the /etc/hosts.
>
> http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
>
>> This works, but is not satisfying: misuse of resources, up to ten
>> minutes without protection after updating the hosts file through the
>> GUI.
>>
>> So I was wondering: would it be possible to launch the script from
>> hosts.cgi whenever this is run, and so run it only once, immediately
>> after the /etc/hosts file has been re-created ?
>>   
you could also add it (appropriately formatted - it's not hard) to the 
end of /var/ipcop/main/hosts, then the hosts.cgi would actually add it 
to /etc/hosts for you next time you edit that.  Just untick one of the 
entries & tick it again, that will be enough to trigger a re-write of 
the list
or you could run the  URLfilter component of IPCOP & add your list to 
the custom blacklist section.  It looks like it can only hold about 8 
entries, but that's just the edit window.  There's not a real limit on 
the size of that list.

of course if you're turning on URLfilter, you might as well tell that to 
block ads as well.

Dave



------------------------------------------------------------------------------
_______________________________________________
IPCop-user mailing list
[email protected]
Manage your subscription or unsubscribe
https://lists.sourceforge.net/lists/listinfo/ipcop-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.