]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/install+setup/install/main.c
in unattended install mode copy restore file
[ipfire-2.x.git] / src / install+setup / install / main.c
index 0fe97a1fdc60813cfa6d0ecda8c502bc0b6ed9fb..bf8f5b2bd762ea14e181bde949bb92ea7efb2dd5 100644 (file)
@@ -66,6 +66,7 @@ int main(int argc, char *argv[])
        int unattended = 0;
        struct keyvalue *unattendedkv = initkeyvalues();
        int hardyn = 0;
+       char restore_file[STRING_SIZE];
 
        setlocale (LC_ALL, "");
        sethostname( SNAME , 10);
@@ -208,6 +209,7 @@ int main(int argc, char *argv[])
            fprintf(flog, "unattended: Reading unattended.conf\n");
 
            (void) readkeyvalues(unattendedkv, UNATTENDED_CONF);
+           findkey(unattendedkv, "RESTORE_FILE", restore_file);            
        }
        
        /* Make the hdparms struct and print the contents.
@@ -538,6 +540,13 @@ int main(int argc, char *argv[])
                goto EXIT;
        }
        
+       /* Copy restore file from cdrom */
+       if (unattended && !strcmp(restore_file, "")) {
+               fprintf(flog, "unattended: Copy restore file\n");
+           snprintf(commandstring, STRING_SIZE, 
+                       "cp /cdrom/%s /harddisk/var/ipfire/backup", restore_file);
+       }
+       
        mysystem("umount /cdrom");
        snprintf(commandstring, STRING_SIZE, "eject /dev/%s", sourcedrive);
        mysystem(commandstring);