diff options
author | Renato Botelho <renato@netgate.com> | 2017-08-16 09:26:28 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-08-16 11:03:12 -0300 |
commit | dff8f2bd0ff5ee9b34b28ece06aac9d73e8eaeeb (patch) | |
tree | a7a68a0e5a01477a3dc5a7dd8922965e9d7e1cbb | |
parent | 2c2a18e9eaf65f1da68a11c78b1b85c1ec8e26b3 (diff) | |
download | pfsense-dff8f2bd0ff5ee9b34b28ece06aac9d73e8eaeeb.zip pfsense-dff8f2bd0ff5ee9b34b28ece06aac9d73e8eaeeb.tar.gz |
Detect old workarounds in config upgrade and deal with them
-rw-r--r-- | src/etc/inc/upgrade_config.inc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index cc21c08..6478a8e 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -5075,6 +5075,17 @@ function additional_config_upgrade() { /* Copy of upgrade_166_to_167 from 2.4 */ if (!isset($already_run['upgrade_166_to_167'])) { + /* + * If this box was updated during the small period of time + * $config latest_version was set to 15.9, reset it to 15.8 + * so we are sure this upgrade will not be skipped when move + * to 2.4 + */ + + if ($config['version'] == "15.9") { + $config['version'] = "15.8"; + } + if (strpos($config['widgets']['sequence'], 'netgate_services_and_support') === false) { $widgets = explode(",", $config['widgets']['sequence']); @@ -5114,10 +5125,17 @@ function additional_config_upgrade() { /* Copy of upgrade_168_to_169() from 2.4 */ if (!isset($already_run['upgrade_168_to_169'])) { + $found = false; + + /* Detect old temporary workaround */ + if (isset($config['cron']['rc_update_pkg_metadata'])) { + unset($config['cron']['rc_update_pkg_metadata']); + $found = true; + } + $command = '/usr/bin/nice -n20 /etc/rc.update_pkg_metadata'; - $found = false; - if (is_array($config['cron']['item'])) { + if (!$found && is_array($config['cron']['item'])) { foreach ($config['cron']['item'] as $entry) { if ($entry['command'] == $command) { $found = true; |