mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-10 19:15:54 +02:00
fixed check for empty string in installer
This commit is contained in:
@@ -541,7 +541,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Copy restore file from cdrom */
|
||||
if (unattended && !strcmp(restore_file, "")) {
|
||||
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);
|
||||
|
||||
@@ -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 /harddisk/var/ipfire/%s", restore_file);
|
||||
if (mysystem(commandstring)) {
|
||||
errorbox("unattended: ERROR restoring backup");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user