aboutsummaryrefslogtreecommitdiffstats
path: root/config/bandwidthd
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-08-15 16:26:31 +0200
committerdoktornotor <notordoktor@gmail.com>2015-08-15 16:26:31 +0200
commitb27cc72bf237732bfc6222682499f3c5f39480fe (patch)
tree45034d03a498ee226991ff703083509367e2baae /config/bandwidthd
parentf3e601b9d9638adfcba7b1a690beca0e0239a2dd (diff)
downloadpfsense-packages-b27cc72bf237732bfc6222682499f3c5f39480fe.tar.gz
pfsense-packages-b27cc72bf237732bfc6222682499f3c5f39480fe.tar.bz2
pfsense-packages-b27cc72bf237732bfc6222682499f3c5f39480fe.zip
bandwidthd - code style and major improvements
Only write upgraded config if there was something actually upgraded.
Diffstat (limited to 'config/bandwidthd')
-rw-r--r--config/bandwidthd/bandwidthd.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/config/bandwidthd/bandwidthd.inc b/config/bandwidthd/bandwidthd.inc
index 6edd255b..9364cbbc 100644
--- a/config/bandwidthd/bandwidthd.inc
+++ b/config/bandwidthd/bandwidthd.inc
@@ -335,9 +335,9 @@ function bandwidthd_upgrade_config() {
$realif = get_real_interface($if);
if (!preg_match("/pppoe[0-9]+/i", $realif)) {
// and finally, set the new config value for config.xml
- echo $if;
$config['installedpackages']['bandwidthd']['config'][0]['interface_array'][$i] = $if;
$i++;
+ $changes++;
}
}
}
@@ -346,7 +346,9 @@ function bandwidthd_upgrade_config() {
unset($config['installedpackages']['bandwidthd']['config'][0]['subnets_custom']);
}
// Write the upgraded config.xml if something changed
- write_config("[bandwidthd] Upgraded old package configuration.");
+ if ($changes > 0 ) {
+ write_config("[bandwidthd] Upgraded old package configuration.");
+ }
}
function bandwidthd_validate_input($post, &$input_errors) {