summaryrefslogtreecommitdiffstats
path: root/etc/inc/config.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-24 19:54:35 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-24 19:54:35 +0000
commit0bfd6d776d259b2bbeeb3239c54a6302ad71bd29 (patch)
treedc8a8f25b9f489206083b6e95e4c1cd202883830 /etc/inc/config.inc
parentc4dfa47bb41176cc1b97ab509461fb0ee7b541a2 (diff)
downloadpfsense-0bfd6d776d259b2bbeeb3239c54a6302ad71bd29.zip
pfsense-0bfd6d776d259b2bbeeb3239c54a6302ad71bd29.tar.gz
File a notice when we restore a previous configuration file.
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r--etc/inc/config.inc6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 433abeb..fe77bab 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -158,6 +158,7 @@ if ($g['booting'] and !file_exists($g['cf_conf_path'] . "/config.xml") ) {
$last_backup = discover_last_backup();
if($last_backup) {
log_error("No config.xml found, attempting last known config restore.");
+ file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", "");
restore_backup("/cf/conf/backup/{$last_backup}");
} else {
/* no device found, print an error and die */
@@ -210,6 +211,7 @@ function parse_config($parse = false) {
$last_backup = discover_last_backup();
if($last_backup) {
log_error("No config.xml found, attempting last known config restore.");
+ file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", "");
restore_backup("{$g['conf_path']}/backup/{$last_backup}");
} else {
die("Config.xml is corrupted and is 0 bytes. Could not restore a previous backup.");
@@ -228,6 +230,7 @@ function parse_config($parse = false) {
config_unlock();
if(!file_exists($g['conf_path'] . "/config.xml")) {
log_error("No config.xml found, attempting last known config restore.");
+ file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", "");
$last_backup = discover_last_backup();
if ($last_backup)
restore_backup("/cf/conf/backup/{$last_backup}");
@@ -240,6 +243,7 @@ function parse_config($parse = false) {
if(!file_exists($g['conf_path'] . "/config.xml")) {
if($g['booting']) echo ".";
log_error("No config.xml found, attempting last known config restore.");
+ file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", "");
$last_backup = discover_last_backup();
if ($last_backup)
restore_backup("/cf/conf/backup/{$last_backup}");
@@ -312,6 +316,7 @@ function restore_backup($file) {
copy("$file","/cf/conf/config.xml");
unlink_if_exists("/tmp/config.cache");
log_error("pfSense is restoring the configuration $file");
+ file_notice("config.xml", "pfSense is restoring the configuration $file", "pfSenseConfigurator", "");
conf_mount_ro();
}
config_unlock();
@@ -346,6 +351,7 @@ function parse_config_bootup() {
$last_backup = discover_last_backup();
if($last_backup) {
log_error("No config.xml found, attempting last known config restore.");
+ file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", "");
restore_backup("/cf/conf/backup/{$last_backup}");
}
if(!file_exists("{$g['conf_path']}/config.xml")) {
OpenPOWER on IntegriCloud