aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2006-12-20 11:50:50 +0000
committerSeth Mos <seth.mos@xs4all.nl>2006-12-20 11:50:50 +0000
commit1a74b4e2152c70a7b45af20a6c66e5fdec0fec72 (patch)
treebf66e6edde48ac77cff25496a759adf03ef5c8fc /packages
parent3e43c1c6c694588ed7caabffa3cf1f87b0be7d75 (diff)
downloadpfsense-packages-1a74b4e2152c70a7b45af20a6c66e5fdec0fec72.tar.gz
pfsense-packages-1a74b4e2152c70a7b45af20a6c66e5fdec0fec72.tar.bz2
pfsense-packages-1a74b4e2152c70a7b45af20a6c66e5fdec0fec72.zip
Start squid after installing, remove squid cache and log after deinstalling.
Diffstat (limited to 'packages')
-rw-r--r--packages/squid.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/squid.inc b/packages/squid.inc
index b45eac83..5bd9fb1d 100644
--- a/packages/squid.inc
+++ b/packages/squid.inc
@@ -97,6 +97,8 @@ function squid_is_valid_acl($acl) {
}
function squid_install_command() {
+ global $config;
+
/* create cache */
squid_dash_z();
/* make sure pinger is executable */
@@ -141,14 +143,28 @@ EOD;
if (!file_exists(SQUID_CONFBASE . '/mime.conf') && file_exists(SQUID_CONFBASE . '/mime.conf.default'))
copy(SQUID_CONFBASE . '/mime.conf.default', SQUID_CONFBASE . '/mime.conf');
+ squid_dash_z();
+
+ if (!is_service_running('squid')) {
+ log_error("Starting Squid");
+ mwexec_bg("/usr/local/sbin/squid -D");
+ } else {
+ log_error("Reloading Squid for configuration sync");
+ mwexec("/usr/local/sbin/squid -k reconfigure");
+ }
+
+ filter_configure();
+
}
function squid_deinstall_command() {
global $config;
$settings = $config['installedpackages']['squidcache']['config'][0];
$cachedir =($settings['harddisk_cache_location'] ? $settings['harddisk_cache_location'] : '/var/squid/cache');
+ $logdir = ($settings['log_dir'] ? $settings['log_dir'] : '/var/squid/log');
mwexec('rm -rf $cachedir');
+ mwexec('rm -rf $logdir');
mwexec('rm -f /usr/local/etc/rc.d/proxy_monitor.sh');
mwexec("ps awux | grep \"proxy_monitor\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill");
mwexec("ps awux | grep \"squid\" | grep -v \"grep\" | awk '{ print $2 }' | xargs kill");