diff options
author | Renato Botelho <renato@netgate.com> | 2015-12-10 18:48:41 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-12-10 19:04:35 -0200 |
commit | b1c2bb3459c24c58046549d1e05786b8e9814b89 (patch) | |
tree | 4ff540ab84fbe707b4886021f2bcd9e87107e16d | |
parent | 69eefb500b9c821715b5d3189368b91cec5744d2 (diff) | |
download | pfsense-b1c2bb3459c24c58046549d1e05786b8e9814b89.zip pfsense-b1c2bb3459c24c58046549d1e05786b8e9814b89.tar.gz |
Write upgrade config to replace apinger by dpinger, it should fix #5624
-rw-r--r-- | src/conf.default/config.xml | 2 | ||||
-rw-r--r-- | src/etc/inc/globals.inc | 2 | ||||
-rw-r--r-- | src/etc/inc/upgrade_config.inc | 50 |
3 files changed, 52 insertions, 2 deletions
diff --git a/src/conf.default/config.xml b/src/conf.default/config.xml index fcd26e8..54003a3 100644 --- a/src/conf.default/config.xml +++ b/src/conf.default/config.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <pfsense> - <version>12.9</version> + <version>13.1</version> <lastchange/> <system> <optimization>normal</optimization> diff --git a/src/etc/inc/globals.inc b/src/etc/inc/globals.inc index 893590d..306639b 100644 --- a/src/etc/inc/globals.inc +++ b/src/etc/inc/globals.inc @@ -71,7 +71,7 @@ $g = array( "disablecrashreporter" => false, "crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php", "debug" => false, - "latest_config" => "13.0", + "latest_config" => "13.1", "nopkg_platforms" => array("cdrom"), "minimum_ram_warning" => "101", "minimum_ram_warning_text" => "128 MB", diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index ccf1a1b..dbb751b 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -4142,4 +4142,54 @@ function upgrade_129_to_130() { } } +function upgrade_130_to_131() { + global $config; + + if (isset($config['syslog']['apinger'])) { + $config['syslog']['dpinger'] = true; + unset($config['syslog']['apinger']); + } + + if (isset($config['system']['apinger_debug'])) { + unset($config['system']['apinger_debug']); + } + + if (!isset($config['gateways']['gateway_item']) || + !is_array($config['gateways']['gateway_item'])) { + return; + } + + foreach ($config['gateways']['gateway_item'] as &$gw) { + // dpinger uses milliseconds + if (isset($gw['interval']) && + is_numeric($gw['interval'])) { + $gw['interval'] = $gw['interval'] * 1000; + } + if (isset($gw['down']) && + is_numeric($gw['down'])) { + $gw['loss_interval'] = $gw['down'] * 1000; + unset($gw['down']); + } + + if (isset($gw['avg_delay_samples'])) { + unset($gw['avg_delay_samples']); + } + if (isset($gw['avg_delay_samples_calculated'])) { + unset($gw['avg_delay_samples_calculated']); + } + if (isset($gw['avg_loss_samples'])) { + unset($gw['avg_loss_samples']); + } + if (isset($gw['avg_loss_samples_calculated'])) { + unset($gw['avg_loss_samples_calculated']); + } + if (isset($gw['avg_loss_delays_samples'])) { + unset($gw['avg_loss_delays_samples']); + } + if (isset($gw['avg_loss_delays_samples_calculated'])) { + unset($gw['avg_loss_delays_samples_calculated']); + } + } +} + ?> |