X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=src%2Finstaller%2Fmain.c;h=36f8dfec8110a48bb6fb1f73c07c35350503550a;hp=ba50cd9b6fe1f1ac3bf8269727fe4dc6e674baf9;hb=38c6822d3c99104978975352bcfe80fb13a94c72;hpb=35853bb47bc3a8dea8591979aa4d23a78c255f60 diff --git a/src/installer/main.c b/src/installer/main.c index ba50cd9b6f..36f8dfec81 100644 --- a/src/installer/main.c +++ b/src/installer/main.c @@ -722,11 +722,24 @@ int main(int argc, char *argv[]) { mysystem(logfile, "/usr/bin/touch /harddisk/var/ipfire/main/gpl_accepted"); /* Copy restore file from cdrom */ - if (unattended && (strlen(restore_file) > 0)) { - fprintf(flog, "unattended: Copy restore file\n"); - snprintf(commandstring, STRING_SIZE, - "cp /cdrom/%s /harddisk/var/ipfire/backup", restore_file); - mysystem(logfile, commandstring); + char* backup_file = hw_find_backup_file(logfile, SOURCE_MOUNT_PATH); + if (backup_file) { + rc = 0; + if (!unattended) { + rc = newtWinOkCancel(title, _("A backup file has been found on the installation image.\n\n" + "Do you want to restore the backup?"), 50, 10, _("Yes"), _("No")); + } + + if (rc == 0) { + rc = hw_restore_backup(logfile, backup_file, DESTINATION_MOUNT_PATH); + + if (rc) { + errorbox(_("An error occured when the backup file was restored.")); + goto EXIT; + } + } + + free(backup_file); } // Umount the destination drive