From a7842c04ba066ff7528353ca5a8118932b7b247e Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 4 Feb 2013 13:19:58 -0500 Subject: Only save/resync if we actually made a change to ext_cachemanager --- config/lightsquid/lightsquid.inc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'config/lightsquid') 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."); + } } } -- cgit v1.2.3