aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-02-04 13:19:58 -0500
committerjim-p <jimp@pfsense.org>2013-02-04 13:19:58 -0500
commita7842c04ba066ff7528353ca5a8118932b7b247e (patch)
treeafd8856399f7c1730f69a6add16e1f45a9bd2dc4
parent61bcdf1c9faa28dd579353c0905d990e4ffeedba (diff)
downloadpfsense-packages-a7842c04ba066ff7528353ca5a8118932b7b247e.tar.gz
pfsense-packages-a7842c04ba066ff7528353ca5a8118932b7b247e.tar.bz2
pfsense-packages-a7842c04ba066ff7528353ca5a8118932b7b247e.zip
Only save/resync if we actually made a change to ext_cachemanager
-rw-r--r--config/lightsquid/lightsquid.inc19
1 files changed, 9 insertions, 10 deletions
diff --git a/config/lightsquid/lightsquid.inc b/config/lightsquid/lightsquid.inc
index 5fd89470..4b31bc30 100644
--- a/config/lightsquid/lightsquid.inc
+++ b/config/lightsquid/lightsquid.inc
@@ -294,16 +294,15 @@ function lightsquid_resync() {
$ifmgr = $ifmgr . $realif[0] . ";";
}
- # ? delete ?
- $config['installedpackages']['squidcache']['config'][0]['ext_cachemanager'] = $ifmgr;
- # now right
- $config['installedpackages']['squidnac']['config'][0]['ext_cachemanager'] = $ifmgr;
-
- write_config();
- if (function_exists('squid_resync')) {
- squid_resync();
- }
- else update_log("Function 'squid_resync' not found.");
+ /* Only save and resync if we're actually making any changes. */
+ if (strpos($config['installedpackages']['squidnac']['config'][0]['ext_cachemanager'], $ifmgr) === FALSE) {
+ $config['installedpackages']['squidnac']['config'][0]['ext_cachemanager'] = $ifmgr;
+ write_config();
+ if (function_exists('squid_resync'))
+ squid_resync();
+ else
+ update_log("Function 'squid_resync' not found.");
+ }
}
}