Re: Where can I add a script
Renaud (Ron) OLGIATI <renaud-9qJ39Kf4vhh95CE/QLhGvQK61p16E/[email protected]>
| Newsgroups | gmane.comp.security.ipcop.user |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 02 Aug 2015 13:10:03 +0100 Rob Brewer <[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 > > > > 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 ? > I suggested this a few years ago and I am still using it: > On your IPCop box add the following line to /etc/dnsmasq.conf > addn-hosts=/etc/hosts.ext > then go to http://www.mvps.org/winhelp2002/hosts.htm > and download the hosts.zip file. > Unzip the file and copy it to /etc/hosts.ext > and restart dnsmasq running /etc/rc.d/rc.updatered Thanks, but -I already have my file of bad hosts -running /etc/rc.d/rc.updatered with the modified conf file does not seem to add the bad hosts to /etc/hosts on my IPCop 2 box ;-3( Cheers, Ron. -- Puritanism: The haunting fear that someone, somewhere, may be happy. -- Henry Louis Mencken -- http://www.olgiati-in-paraguay.org -- ------------------------------------------------------------------------------ _______________________________________________ IPCop-user mailing list [email protected] Manage your subscription or unsubscribe https://lists.sourceforge.net/lists/listinfo/ipcop-user