diff options
-rw-r--r-- | packages/squid.inc | 14 | ||||
-rw-r--r-- | packages/squid.xml | 8 |
2 files changed, 20 insertions, 2 deletions
diff --git a/packages/squid.inc b/packages/squid.inc index deab63d9..c10217a0 100644 --- a/packages/squid.inc +++ b/packages/squid.inc @@ -183,7 +183,11 @@ function squid_validate_general($post, $input_errors) { } else { $port = trim($post['proxy_port']); } + $webgui_port = $config['system']['webgui']['port']; + if($config['system']['webgui']['port'] == "") { + $webgui_port = 80; + } if ($port == $webgui_port) { $input_errors[] = "You can not run squid on the same port as the webgui"; @@ -738,8 +742,14 @@ function squid_resync() { } - log_error("Reloading Squid for configuration sync"); - mwexec("/usr/local/sbin/squid -k reconfigure"); + if (!is_service_running('squid')) { + log_error("Starting Squid"); + mwexec_bg("/usr/local/sbin/squid -D"); + mwexec_bg("/usr/local/etc/rc.d/proxy_monitor.sh"); + } else { + log_error("Reloading Squid for configuration sync"); + mwexec("/usr/local/sbin/squid -k reconfigure"); + } filter_configure(); } diff --git a/packages/squid.xml b/packages/squid.xml index 09326f4b..13398b3d 100644 --- a/packages/squid.xml +++ b/packages/squid.xml @@ -113,6 +113,14 @@ <type>checkbox</type> </field> <field> + <fieldname>log_dir</fieldname> + <fielddescr>Log store directory</fielddescr> + <description>The directory where the log will be stored (note: do not end with a / mark)</description> + <type>input</type> + <size>60</size> + <default_value>/var/squid/log</default_value> + </field> + <field> <fieldname>proxy_port</fieldname> <fielddescr>Proxy port</fielddescr> <description>This is the port the proxy server will listen on.</description> |