diff options
author | Scott Ullrich <sullrich@gmail.com> | 2011-09-25 20:27:28 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@gmail.com> | 2011-09-25 20:27:28 -0400 |
commit | b8bfcce55022da7095df386aee635d9f8fe24aa6 (patch) | |
tree | 815e42774e126d52e45c0d8b1841013c80b064a8 | |
parent | e40d415ab308d7b718c874c130bc7392122e1d56 (diff) | |
download | pfsense-b8bfcce55022da7095df386aee635d9f8fe24aa6.zip pfsense-b8bfcce55022da7095df386aee635d9f8fe24aa6.tar.gz |
Add option to not restore config.xml
-rwxr-xr-x | etc/rc.restore_full_backup | 8 | ||||
-rwxr-xr-x | usr/local/www/system_firmware_restorefullbackup.php | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/etc/rc.restore_full_backup b/etc/rc.restore_full_backup index 9e3d6ce..05bb060 100755 --- a/etc/rc.restore_full_backup +++ b/etc/rc.restore_full_backup @@ -4,7 +4,13 @@ echo -n "Checking..." if [ `tar tzPf $1 /etc/rc 2>/dev/null` ]; then echo " Backup file looks OK." echo "One moment, restoring ${1}..." - tar xzPfU $1 -C / 2>/var/etc/restore_log.txt + if [ -f /tmp/do_not_restore_config.xml ]; then + EXCLUDE="--exclude /cf/conf/config.xml" + rm /tmp/do_not_restore_config.xml + else + EXCLUDE="" + fi + tar xzPfU $1 $EXCLUDE -C / 2>/var/etc/restore_log.txt echo "Restore of $1 complete." else echo " Error." diff --git a/usr/local/www/system_firmware_restorefullbackup.php b/usr/local/www/system_firmware_restorefullbackup.php index 651ef64..3d5a941 100755 --- a/usr/local/www/system_firmware_restorefullbackup.php +++ b/usr/local/www/system_firmware_restorefullbackup.php @@ -55,6 +55,9 @@ require_once("functions.inc"); require_once("filter.inc"); require_once("shaper.inc"); +if($_POST['overwriteconfigxml']) + touch("/tmp/do_not_restore_config.xml"); + if ($_POST['restorefile']) { $filename = $_POST['restorefile']; if(file_exists("/root/{$filename}")) { @@ -124,6 +127,9 @@ include("head.inc"); ?> <tr> <td width="78%" class="vtable" colspan="2"> + <br/> + <input type="checkbox" name="overwriteconfigxml" id="overwriteconfigxml" CHECKED> do not restore config.xml. + <p/> <input name="Restore" type="submit" class="formbtn" id="restore" value="<?=gettext("Restore"); ?>"> </td> </tr> |