mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-12 04:05:53 +02:00
In installer, there is an unattended option that allows definition of a backup archive.
This commit is contained in:
committed by
Michael Tremer
parent
034a390e6c
commit
b5cf97172c
@@ -41,6 +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];
|
||||
|
||||
findkey(unattendedkv, "DOMAINNAME", domainname);
|
||||
findkey(unattendedkv, "HOSTNAME", hostname);
|
||||
@@ -54,6 +55,7 @@ int unattended_setup(struct keyvalue *unattendedkv) {
|
||||
findkey(unattendedkv, "GREEN_BROADCAST", green_broadcast);
|
||||
findkey(unattendedkv, "ROOT_PASSWORD", root_password);
|
||||
findkey(unattendedkv, "ADMIN_PASSWORD", admin_password);
|
||||
findkey(unattendedkv, "RESTORE_FILE", restore_file);
|
||||
|
||||
/* write main/settings. */
|
||||
replacekeyvalue(mainsettings, "DOMAINNAME", domainname);
|
||||
@@ -144,6 +146,16 @@ int unattended_setup(struct keyvalue *unattendedkv) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* restore backup */
|
||||
if (restore_file != "") {
|
||||
fprintf(flog, "unattended: Restoring Backup\n");
|
||||
snprintf(commandstring, STRING_SIZE,
|
||||
"cd /harddisk && /bin/tar -xvz --preserve -f /cdrom/%s", restore_file);
|
||||
if (mysystem(commandstring)) {
|
||||
errorbox("unattended: ERROR setting admin password");
|
||||
return 0;
|
||||
}
|
||||
|
||||
fprintf(flog, "unattended: Setup ended\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user