summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-08-08 16:36:01 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-08-08 16:36:01 +0000
commit1a23410cd16cd6ce77090ab3c0a9d67acfaf3e8f (patch)
treec5409b455b80dee5b1c51a87527b0fa2665aa5cb /etc
parentbf2e1048dbd8d9a6009d631a37c6ecc4c36bb947 (diff)
downloadpfsense-1a23410cd16cd6ce77090ab3c0a9d67acfaf3e8f.zip
pfsense-1a23410cd16cd6ce77090ab3c0a9d67acfaf3e8f.tar.gz
Attempt restore of previous backup if we are halting.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/config.inc15
1 files changed, 10 insertions, 5 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 8602ef7..5386abe 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -143,9 +143,13 @@ if ($g['booting'] and !file_exists($g['cf_conf_path'] . "/config.xml") ) {
}
if (!$cfgdevice) {
- /* no device found, print an error and die */
- echo <<<EOD
-
+ $last_backup = discover_last_backup();
+ if($last_backup) {
+ log_error("No config.xml found, attempting last known config restore.");
+ restore_backup("/cf/conf/backup/{$last_backup}");
+ } else {
+ /* no device found, print an error and die */
+ echo <<<EOD
*******************************************************************************
* FATAL ERROR *
@@ -156,8 +160,9 @@ if ($g['booting'] and !file_exists($g['cf_conf_path'] . "/config.xml") ) {
EOD;
- mwexec("/sbin/halt");
- exit;
+ mwexec("/sbin/halt");
+ exit;
+ }
}
/* write device name to a file for rc.firmware */
OpenPOWER on IntegriCloud