Add uniqid tag to CARP VIPs that don't have one upon upgrade. Ticket #4858

This commit is contained in:
Chris Buechler 2016-01-25 18:22:03 -06:00
parent 3756fd8603
commit a34c263bef
3 changed files with 16 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<pfsense>
<version>13.9</version>
<version>14.0</version>
<lastchange/>
<system>
<optimization>normal</optimization>

View File

@ -99,7 +99,7 @@ $g = array(
"disablecrashreporter" => false,
"crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php",
"debug" => false,
"latest_config" => "13.9",
"latest_config" => "14.0",
"nopkg_platforms" => array("cdrom"),
"minimum_ram_warning" => "101",
"minimum_ram_warning_text" => "128 MB",

View File

@ -4337,4 +4337,18 @@ function upgrade_138_to_139() {
}
}
function upgrade_139_to_140() {
global $config;
if (is_array($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $idx => $vip) {
if ($vip['mode'] == "carp") {
if (!isset($vip['uniqid'])) {
$config['virtualip']['vip'][$idx]['uniqid'] = uniqid();
}
}
}
}
}
?>