Re: Where can I add a script
Rob Brewer <[email protected]>
| Newsgroups | gmane.comp.security.ipcop.user |
|---|---|
| Organization | Megadodo Publications |
| Message-ID | <[email protected]> |
Renaud OLGIATI 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 ? > > Cheers, > > Ron. 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 (run /etc/rc.d/rc.updatered) Bob ------------------------------------------------------------------------------ _______________________________________________ IPCop-user mailing list [email protected] Manage your subscription or unsubscribe https://lists.sourceforge.net/lists/listinfo/ipcop-user