diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-08-09 00:00:53 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-08-09 00:00:53 +0000 |
commit | 63cc5ece5972fdb7ab7b11b54ba1d9d4c6e5b01a (patch) | |
tree | b57e552e06ce5a393a78efaa40155945d62306fb /etc/inc | |
parent | db9db2a86ec7486fbbaf4d0f41c4baffe70b3822 (diff) | |
download | pfsense-63cc5ece5972fdb7ab7b11b54ba1d9d4c6e5b01a.zip pfsense-63cc5ece5972fdb7ab7b11b54ba1d9d4c6e5b01a.tar.gz |
If no config.xml is found, attempt restore from the latest backup.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/config.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index f1225ab..11eb70f 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -218,6 +218,14 @@ function parse_config($parse = false) { $config = parse_config(true); } } else { + if(!file_exists($g['conf_path'] . "/config.xml")) { + log_error(gettext("No config.xml found, attempting last known config restore.")); + $last_backup = discover_last_backup(); + if ($last_backup) + restore_backup("/cf/conf/backup/{$last_backup}"); + else + log_error(gettext("Could not restore config.xml.")); + } $config = parse_xml_config($g['conf_path'] . '/config.xml', $g['xml_rootobj']); generate_config_cache($config); } |