Add option to perform full backup prior to upgrade. First commit of 2011 pfSense hackathon!

This commit is contained in:
Scott Ullrich 2011-09-25 17:01:03 -04:00
parent 0c13b5f6aa
commit b2a67b558c
2 changed files with 11 additions and 0 deletions

View File

@ -398,6 +398,12 @@ pfSenseupgrade)
touch /var/run/firmwarelock.dirty
if [ -f /tmp/perform_full_backup.txt ]; then
echo "Performing full backup" >> /conf/upgrade_log.txt
/etc/rc.create_full_backup
rm /tmp/perform_full_backup.txt
fi
touch /conf/upgrade_log.txt
echo "" >> /conf/upgrade_log.txt

View File

@ -111,6 +111,9 @@ if(is_subsystem_dirty('firmwarelock')) {
exit;
}
if($_POST['backupbeforeupgrade'])
touch("/tmp/perform_full_backup.txt");
if($_POST['kerneltype']) {
if($_POST['kerneltype'] == "single")
system("touch /boot/kernel/pfsense_kernel.txt");
@ -289,6 +292,8 @@ if(stristr($_FILES['ulfile']['name'],"nanobsd"))
<input name="Submit" type="submit" class="formbtn" value="Upgrade firmware" onClick="window.open('upload_progress.php?upload_id=<?=$upload_id?>','UploadMeter','width=370,height=115', true); return true;">
*/
?>
<input type="checkbox" name='backupbeforeupgrade' id='backupbeforeupgrade'> <?=gettext("Perform full backup prior to upgrade");?>
<br><br>
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Upgrade firmware");?>">
<?php endif; else: ?>
<strong><?=gettext("You must reboot the system before you can upgrade the firmware.");?></strong>