diff options
-rw-r--r-- | etc/inc/config.inc | 12 |
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 |