summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-24 18:15:44 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-24 18:15:44 +0000
commit1b07cd630421c369513d72d669dfb237bd2c70ad (patch)
tree881183d23cf8a84f7c4f0cd4dd813edf9fc94f65
parentbe973d8c27e4fa042b040419b13343525bf8d0e2 (diff)
downloadpfsense-1b07cd630421c369513d72d669dfb237bd2c70ad.zip
pfsense-1b07cd630421c369513d72d669dfb237bd2c70ad.tar.gz
Detect 0 byte config.xml cases and attempt to restore a previous backup. With this change my wrap that has been panicing for 30 hours straight boots right back off and we will continue the panic torture test.
-rw-r--r--etc/inc/config.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 9f885d2..2230533 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -206,6 +206,16 @@ EOD;
******/
function parse_config($parse = false) {
global $g;
+ if(filesize("{$g['conf_path']}/config.xml") == 0) {
+ $last_backup = discover_last_backup();
+ if($last_backup) {
+ log_error("No config.xml found, attempting last known config restore.");
+ restore_backup("{$g['conf_path']}/backup/{$last_backup}");
+ } else {
+ die("Config.xml is corrupted and is 0 bytes. Could not restore a previous backup.");
+ }
+ }
+
if($g['booting']) echo ".";
config_lock();
if(!$parse) {
OpenPOWER on IntegriCloud