]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/install+setup/install/unattended.c
Don't remove old kernel version at update of linux-xen
[people/pmueller/ipfire-2.x.git] / src / install+setup / install / unattended.c
index ad143399dc657abef25c0606c12b2756ca8f0c8f..cfdf3314549efdb6b2ca652c81aaa27bde8a2c74 100644 (file)
@@ -41,7 +41,7 @@ int unattended_setup(struct keyvalue *unattendedkv) {
     char green_broadcast[STRING_SIZE];
     char root_password[STRING_SIZE];
     char admin_password[STRING_SIZE];
-    char restore_file[STRING_SIZE];
+    char restore_file[STRING_SIZE] = "";
 
     findkey(unattendedkv, "DOMAINNAME", domainname);
     findkey(unattendedkv, "HOSTNAME", hostname);
@@ -147,13 +147,12 @@ int unattended_setup(struct keyvalue *unattendedkv) {
     }
 
        /* restore backup */
-       if (!strcmp(restore_file, "")) {
+       if (strlen(restore_file) > 0) {
                fprintf(flog, "unattended: Restoring Backup\n");
            snprintf(commandstring, STRING_SIZE,
-                   "cd /harddisk && /bin/tar -xvz --preserve -f /cdrom/%s", restore_file);
+                   "cd /harddisk && /bin/tar -xvzp -f /harddisk/var/ipfire/backup/%s", restore_file);
            if (mysystem(commandstring)) {
-               errorbox("unattended: ERROR restoring backup");
-               return 0;
+               errorbox("unattended: ERROR restoring backup");
            }
        }