From cfead4c8a8bd9568fdaae248fc6e32e4b435c757 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 9 Aug 2019 16:17:44 +0200 Subject: [PATCH] Config: when no backup could be restored, last resort should always be to go back to factory defaults (in the unlikely event that one of the backups are readable, it should not exit without a config) --- src/opnsense/mvc/app/library/OPNsense/Core/Config.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/opnsense/mvc/app/library/OPNsense/Core/Config.php b/src/opnsense/mvc/app/library/OPNsense/Core/Config.php index f1e2a25d7..4f1411c35 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Core/Config.php +++ b/src/opnsense/mvc/app/library/OPNsense/Core/Config.php @@ -296,11 +296,10 @@ class Config extends Singleton $logger->error("failed restoring " . $backup); } } - } else { - // in case there are no backups, restore defaults. - $logger->error(gettext('No valid config.xml found, attempting to restore factory config.')); - $this->restoreBackup('/usr/local/etc/config.xml'); } + // in case there are no backups, restore defaults. + $logger->error(gettext('No valid config.xml found, attempting to restore factory config.')); + $this->restoreBackup('/usr/local/etc/config.xml'); } }