diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/config.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index b6dae66..9f885d2 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -353,6 +353,16 @@ function parse_config_bootup() { } } + 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."); + } + } + parse_config(true); if ((float)$config['version'] > (float)$g['latest_config']) { |