Re: Where can I add a script

Koko Wijatmoko <[email protected]>
Newsgroups gmane.comp.security.ipcop.user
Message-ID <[email protected]>
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 ?
>  

------------------------------------------------------------------------------
_______________________________________________
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.