{"id":605,"date":"2013-04-08T21:03:35","date_gmt":"2013-04-08T20:03:35","guid":{"rendered":"http:\/\/www.jbahillo.com\/?page_id=605"},"modified":"2013-04-08T21:03:35","modified_gmt":"2013-04-08T20:03:35","slug":"bash-testing-a-squid-acl","status":"publish","type":"page","link":"https:\/\/www.jbahillo.com\/?page_id=605","title":{"rendered":"[Bash] Testing a squid ACL"},"content":{"rendered":"<p>Imagine you have configured your squid, with dansguardian, and a shallalist.<br \/>\nYou launch squid and&#8230; bump, it says that one of your ACL&#8217;s is a bungled one. You check syntax&#8230; and it&#8217;s perfect. What the hell is happening here?<\/p>\n<p>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&#8230;. or better let this script to do.<\/p>\n<p>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&#8230; file in squid.conf for the \/etc\/squid3\/test.txt) and check squid config, and so on with every file<\/p>\n<pre class=\"brush: bash; auto-links: true; collapse: false; gutter: true; first-line: 1; highlight: []; html-script: false; light: false; pad-line-numbers: true; toolbar: true; wrap-lines: true\">\n#!\/bin\/bash\nnumero=1\nfor e in $(cat \/var\/lib\/zentyal\/files\/squid\/categories\/Zentyal_security_updates\/BL\/jobsearch\/domains.squid)\ndo\necho $e &gt;&gt;\/etc\/squid3\/test.txt\n\/usr\/sbin\/squid3 -k parse |&amp; grep  &quot;FATAL:&quot;\necho &quot;linea &quot; $numero &quot; OK&quot;\nnumero=$( expr $numero + 1)\ndone\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Imagine you have configured your squid, with dansguardian, and a shallalist. You launch squid and&#8230; bump, it says that one of your ACL&#8217;s is a bungled one. You check syntax&#8230; and it&#8217;s perfect. What the hell is happening here? Well,&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.jbahillo.com\/?page_id=605\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":21,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"ep_exclude_from_search":false,"footnotes":""},"class_list":["post-605","page","type-page","status-publish","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Script that check line per line a file included in a squid ACL\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"keywords\" content=\"bash,squid,acl,dansguardian\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.jbahillo.com\/?page_id=605\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"es_ES\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Javier Bahillo | Blog de un Administrador de Sistemas\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"[Bash] Testing a squid ACL | Javier Bahillo\" \/>\n\t\t<meta property=\"og:description\" content=\"Script that check line per line a file included in a squid ACL\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.jbahillo.com\/?page_id=605\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-04-08T20:03:35+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2013-04-08T20:03:35+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"[Bash] Testing a squid ACL | Javier Bahillo\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Script that check line per line a file included in a squid ACL\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=605#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com#listItem\",\"position\":1,\"name\":\"Inicio\",\"item\":\"https:\\\/\\\/www.jbahillo.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=605#listItem\",\"name\":\"[Bash] Testing a squid ACL\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=605#listItem\",\"position\":2,\"name\":\"[Bash] Testing a squid ACL\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com#listItem\",\"name\":\"Inicio\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#organization\",\"name\":\"Javier Bahillo\",\"description\":\"Blog de un Administrador de Sistemas\",\"url\":\"https:\\\/\\\/www.jbahillo.com\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=605#webpage\",\"url\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=605\",\"name\":\"[Bash] Testing a squid ACL | Javier Bahillo\",\"description\":\"Script that check line per line a file included in a squid ACL\",\"inLanguage\":\"es-ES\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?page_id=605#breadcrumblist\"},\"datePublished\":\"2013-04-08T21:03:35+01:00\",\"dateModified\":\"2013-04-08T21:03:35+01:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#website\",\"url\":\"https:\\\/\\\/www.jbahillo.com\\\/\",\"name\":\"Javier Bahillo\",\"description\":\"Blog de un Administrador de Sistemas\",\"inLanguage\":\"es-ES\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"[Bash] Testing a squid ACL | Javier Bahillo","description":"Script that check line per line a file included in a squid ACL","canonical_url":"https:\/\/www.jbahillo.com\/?page_id=605","robots":"max-image-preview:large","keywords":"bash,squid,acl,dansguardian","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/www.jbahillo.com\/?page_id=605#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com#listItem","position":1,"name":"Inicio","item":"https:\/\/www.jbahillo.com","nextItem":{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com\/?page_id=605#listItem","name":"[Bash] Testing a squid ACL"}},{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com\/?page_id=605#listItem","position":2,"name":"[Bash] Testing a squid ACL","previousItem":{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com#listItem","name":"Inicio"}}]},{"@type":"Organization","@id":"https:\/\/www.jbahillo.com\/#organization","name":"Javier Bahillo","description":"Blog de un Administrador de Sistemas","url":"https:\/\/www.jbahillo.com\/"},{"@type":"WebPage","@id":"https:\/\/www.jbahillo.com\/?page_id=605#webpage","url":"https:\/\/www.jbahillo.com\/?page_id=605","name":"[Bash] Testing a squid ACL | Javier Bahillo","description":"Script that check line per line a file included in a squid ACL","inLanguage":"es-ES","isPartOf":{"@id":"https:\/\/www.jbahillo.com\/#website"},"breadcrumb":{"@id":"https:\/\/www.jbahillo.com\/?page_id=605#breadcrumblist"},"datePublished":"2013-04-08T21:03:35+01:00","dateModified":"2013-04-08T21:03:35+01:00"},{"@type":"WebSite","@id":"https:\/\/www.jbahillo.com\/#website","url":"https:\/\/www.jbahillo.com\/","name":"Javier Bahillo","description":"Blog de un Administrador de Sistemas","inLanguage":"es-ES","publisher":{"@id":"https:\/\/www.jbahillo.com\/#organization"}}]},"og:locale":"es_ES","og:site_name":"Javier Bahillo | Blog de un Administrador de Sistemas","og:type":"article","og:title":"[Bash] Testing a squid ACL | Javier Bahillo","og:description":"Script that check line per line a file included in a squid ACL","og:url":"https:\/\/www.jbahillo.com\/?page_id=605","article:published_time":"2013-04-08T20:03:35+00:00","article:modified_time":"2013-04-08T20:03:35+00:00","twitter:card":"summary","twitter:title":"[Bash] Testing a squid ACL | Javier Bahillo","twitter:description":"Script that check line per line a file included in a squid ACL"},"aioseo_meta_data":{"post_id":"605","title":"[Bash] Testing a squid ACL | #site_title","description":"Script that check line per line a file included in a squid ACL","keywords":[{"label":"bash","value":"bash"},{"label":"squid","value":"squid"},{"label":"ACL","value":"ACL"},{"label":"dansguardian","value":"dansguardian"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"","defaultPostTypeGraph":""},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-04-23 00:43:21","updated":"2025-06-03 23:08:31","seo_analyzer_scan_date":null},"jetpack_shortlink":"https:\/\/wp.me\/P74T96-9L","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/pages\/605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=605"}],"version-history":[{"count":1,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/pages\/605\/revisions"}],"predecessor-version":[{"id":608,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/pages\/605\/revisions\/608"}],"wp:attachment":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}