Testing a squid ACL

Imagine you have configured your squid, with dansguardian, and a shallalist.
You launch squid and… bump, it says that one of your ACL’s is a bungled one. You check syntax… and it’s perfect. What the hell is happening here?

Well, it might be that the file that ACL is referring to is wrong. You have a broad look to it, and everything seems fine. But it is still breaking your squid config. Perhaps there is some duplicate, or perhaps some incorrect line, but perhaps your file is 10000 lines long, and checking each one might be a hard job. But it is actually what you should, do…. or better let this script to do.

It will check the wrong file and add each line one per line, add it to another file (you will have to change the /var/lib… file in squid.conf for the /etc/squid3/test.txt) and check squid config, and so on with every file

for e in $(cat /var/lib/zentyal/files/squid/categories/Zentyal_security_updates/BL/jobsearch/domains.squid)
echo $e >>/etc/squid3/test.txt
/usr/sbin/squid3 -k parse |& grep  "FATAL:"
echo "linea " $numero " OK"
numero=$( expr $numero + 1)

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.