diff options
-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> |