<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Modifying squid.conf when WAN is up / down ?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I don't know if it's possible but to solve my problem and use a backup proxy available in OPT1, a solution could be to change squid.conf in real time.</p>
<p dir="auto">If WAN is up, squid is up in transparent mode with SquidGuard or HAVP for high security.<br />
If WAN is down, squid is not in transparent mode and just use a parent proxy and "never_direct allow all" is activated.</p>
<p dir="auto">I think i can create the two squid.conf but i dont know how to monitor WAN and execute a script ?</p>
<p dir="auto">With PHPService ?<br />
And to reload squid ?</p>
<p dir="auto">Thanks</p>
<p dir="auto">Guldil.</p>
]]></description><link>https://forum.netgate.com/topic/17035/modifying-squid-conf-when-wan-is-up-down</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Nov 2026 20:58:16 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/17035.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Jul 2009 08:13:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Modifying squid.conf when WAN is up / down ? on Fri, 14 Aug 2009 10:03:07 GMT]]></title><description><![CDATA[<p dir="auto">Finally it dosen't work :(<br />
With my multiwan config squid on the pfsense is lost with DNS resolution…Sometimes it's working, sometimes not...The OPT1 is really important for my client so i need a perfect access.</p>
<p dir="auto">I put a debian lenny only with squid3 on my lan and it's working really better, the squid is configured to use the pfsense as DNS server and default gateway.<br />
If i put down my WAN connection, it send an alert to the Squid3 wich restart with a special "conf" and use the parent proxy from my OPT1.</p>
]]></description><link>https://forum.netgate.com/post/205179</link><guid isPermaLink="true">https://forum.netgate.com/post/205179</guid><dc:creator><![CDATA[Guldil]]></dc:creator><pubDate>Fri, 14 Aug 2009 10:03:07 GMT</pubDate></item><item><title><![CDATA[Reply to Modifying squid.conf when WAN is up / down ? on Fri, 31 Jul 2009 13:33:30 GMT]]></title><description><![CDATA[<p dir="auto">Can you attach the code and make this a sticky. This would be really useful for many people.</p>
]]></description><link>https://forum.netgate.com/post/204228</link><guid isPermaLink="true">https://forum.netgate.com/post/204228</guid><dc:creator><![CDATA[tommyboy180]]></dc:creator><pubDate>Fri, 31 Jul 2009 13:33:30 GMT</pubDate></item><item><title><![CDATA[Reply to Modifying squid.conf when WAN is up / down ? on Fri, 31 Jul 2009 12:28:07 GMT]]></title><description><![CDATA[<p dir="auto">Thanks a lot dvserg, it's working :)</p>
]]></description><link>https://forum.netgate.com/post/204224</link><guid isPermaLink="true">https://forum.netgate.com/post/204224</guid><dc:creator><![CDATA[Guldil]]></dc:creator><pubDate>Fri, 31 Jul 2009 12:28:07 GMT</pubDate></item><item><title><![CDATA[Reply to Modifying squid.conf when WAN is up / down ? on Fri, 31 Jul 2009 15:26:27 GMT]]></title><description><![CDATA[<p dir="auto">squid config generated by squid_resync() cmd or by Save button ib GUI or by pfSense restart.<br />
squid service start/stop use current config.<br />
if you want generate config with GUI mechanism - use php script</p>
<p dir="auto">…<br />
required_once ('squid.inc');<br />
...</p>
<h1><a class="anchor-offset" name="setup-new-config"></a>setup new config</h1>
<p dir="auto">...<br />
write_config();<br />
squid_resync();<br />
...</p>
<p dir="auto">But bad way generate new conf each up&lt;&gt;down state WAN Maybe need recheck state via timeout</p>
<p dir="auto">&lt;monitor state="" cycle=""&gt;test state - if changed - wite (30-60s) - check state new =&gt; generate squid conf<br />
..&lt;/monitor&gt;</p>
]]></description><link>https://forum.netgate.com/post/204178</link><guid isPermaLink="true">https://forum.netgate.com/post/204178</guid><dc:creator><![CDATA[dvserg]]></dc:creator><pubDate>Fri, 31 Jul 2009 15:26:27 GMT</pubDate></item><item><title><![CDATA[Reply to Modifying squid.conf when WAN is up / down ? on Thu, 30 Jul 2009 16:38:21 GMT]]></title><description><![CDATA[<p dir="auto">Ok thanks i'm on the good way then.</p>
<p dir="auto">Squid.conf is generated by pfsense on start / stop service right ?</p>
<p dir="auto">But where are stored the configuration ?</p>
<p dir="auto">I want to make something smart, stop squid, modifying squid.conf stored in Pfsense, start squid.<br />
So i just have to put my conf somewhere but if i control with WebGUI i'll see the real conf.</p>
<p dir="auto">EDIT :<br />
with this kind of php code i can change my config :)</p>
<pre><code>
require_once("pfsense-utils.inc");
require_once("functions.inc");
require_once('config.inc');

var_dump($config['installedpackages']['squid']);
var_dump($config['installedpackages']['squidcache']);

$config['installedpackages']['squid']['config'][0]['admin_email'] = "admin@localhost";

write_config();
</code></pre>
]]></description><link>https://forum.netgate.com/post/204117</link><guid isPermaLink="true">https://forum.netgate.com/post/204117</guid><dc:creator><![CDATA[Guldil]]></dc:creator><pubDate>Thu, 30 Jul 2009 16:38:21 GMT</pubDate></item><item><title><![CDATA[Reply to Modifying squid.conf when WAN is up / down ? on Thu, 30 Jul 2009 10:17:35 GMT]]></title><description><![CDATA[<p dir="auto">As variant:</p>
<ul>
<li>make and start sh/php script for monitoring Wan state</li>
</ul>
<ol>
<li>get string from grep ifconfig wan state &amp; memory last state</li>
<li>check state change with prevoius</li>
<li>if state changed - reconfigure squid, else - nothing</li>
<li>sleep 30-60c</li>
<li>goto 1</li>
</ol>
<p dir="auto">squid reconfiguring :</p>
<ul>
<li>stop squid:  killall squid</li>
<li>start squid: squid …tram-pam-pam-keys.. /selected_config_path</li>
</ul>
]]></description><link>https://forum.netgate.com/post/204094</link><guid isPermaLink="true">https://forum.netgate.com/post/204094</guid><dc:creator><![CDATA[dvserg]]></dc:creator><pubDate>Thu, 30 Jul 2009 10:17:35 GMT</pubDate></item></channel></rss>