summaryrefslogtreecommitdiffstats
path: root/etc/inc/config.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-08-23 17:06:30 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-08-23 17:06:30 -0400
commit626777e024ea3d083878d28db3d0f7dbf86b2de3 (patch)
tree4b871fe5c7214cc833d0bb12636c9ed98d9749d9 /etc/inc/config.inc
parentf43ba92685f6f07f2e57a3c6a1b2034b8728f1e8 (diff)
downloadpfsense-626777e024ea3d083878d28db3d0f7dbf86b2de3.zip
pfsense-626777e024ea3d083878d28db3d0f7dbf86b2de3.tar.gz
Unbreak config_restore()
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r--etc/inc/config.inc12
1 files changed, 8 insertions, 4 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 166f2c9..31dad3c 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -692,18 +692,22 @@ function config_restore($conffile) {
if (!file_exists($conffile))
return 1;
- $lockkey = lock('config');
conf_mount_rw();
backup_config();
+
+ $lockkey = lock('config');
+
copy($conffile, "{$g['cf_conf_path']}/config.xml");
+ unlink_if_exists("/tmp/config.cache");
+
unlock($lockkey);
+
$config = parse_config(true);
- $lockkey = lock('config');
+
write_config("Reverted to " . array_pop(explode("/", $conffile)) . ".", false);
conf_mount_ro();
- unlock($lockkey);
return 0;
}
@@ -1315,4 +1319,4 @@ if($config_parsed == true) {
}
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud