summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/upgrade_config.inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/etc/inc/upgrade_config.inc')
-rw-r--r--src/etc/inc/upgrade_config.inc62
1 files changed, 53 insertions, 9 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc
index a8d5370..7a38554 100644
--- a/src/etc/inc/upgrade_config.inc
+++ b/src/etc/inc/upgrade_config.inc
@@ -5328,8 +5328,8 @@ function upgrade_165_to_166() {
function upgrade_166_to_167() {
global $config;
- if (strpos($config['widgets']['sequence'], 'netgate_services_and_support') === false) {
-
+ if (strpos($config['widgets']['sequence'],
+ 'netgate_services_and_support') === false) {
$widgets = explode(",", $config['widgets']['sequence']);
$cnt = count($widgets);
$col2 = $cnt;
@@ -5337,20 +5337,25 @@ function upgrade_166_to_167() {
// Locate the firt column 2 widget
for ($idx=0;$idx<$cnt;$idx++) {
- if (strpos($widgets[$idx], 'col2') !== false) {
- $col2 = $idx;
- break;
+ if (strpos($widgets[$idx], 'col2') !== false) {
+ $col2 = $idx;
+ break;
}
}
- // Loop through the widgets inserting the new widget before the first col2 widget
+ /*
+ * Loop through the widgets inserting the new widget before
+ * the first col2 widget
+ */
for ($old=0,$new=0;$old<$cnt;$old++,$new++) {
$newsequence[$new] = $widgets[$old];
- if ($old == ($col2 - 1)) {
- $new++;
- $newsequence[$new] = "netgate_services_and_support:col2:open:0";
+ if ($old != ($col2 - 1)) {
+ continue;
}
+ $new++;
+ $newsequence[$new] =
+ "netgate_services_and_support:col2:open:0";
}
$config['widgets']['sequence'] = implode(",", $newsequence);
@@ -5360,4 +5365,43 @@ function upgrade_166_to_167() {
function upgrade_167_to_168() {
upgrade_166_to_167();
}
+
+function upgrade_168_to_169() {
+ global $config;
+
+ /* Remove workaround added in 2.3 */
+ unset($config['cron']['rc_update_pkg_metadata']);
+
+ $command = '/usr/bin/nice -n20 /etc/rc.update_pkg_metadata';
+ if (is_array($config['cron']['item'])) {
+ foreach ($config['cron']['item'] as $entry) {
+ if ($entry['command'] == $command) {
+ return;
+ }
+ }
+ }
+
+ $config['cron']['item'][] = array(
+ 'minute' => '1',
+ 'hour' => '0',
+ 'mday' => '*',
+ 'month' => '*',
+ 'wday' => '*',
+ 'who' => 'root',
+ 'command' => $command
+ );
+}
+
+/*
+ * Special function that is called independent of current config version. It's
+ * a workaround to have config_upgrade running on older versions after next
+ * config version was already taken by newer pfSense.
+ *
+ * XXX Change the way we handle config version to make it based on product
+ * version
+ */
+function additional_config_upgrade() {
+ global $config;
+}
+
?>
OpenPOWER on IntegriCloud