|
|
|
@ -43,13 +43,18 @@ char* template_format_save(vector* vec_temp) {
|
|
|
|
|
|
|
|
|
|
char* save_format_status_cmd_all(vector* vec_temp, vector* vec_status_disk) {
|
|
|
|
|
char* cmd = yon_char_new("");
|
|
|
|
|
char* str_cmd_format = NULL;
|
|
|
|
|
if (vec_temp->vectorList.total > 0 && vec_status_disk->vectorList.total > 0) {
|
|
|
|
|
for (int i=0; i < vec_temp->vectorList.total; i++) {
|
|
|
|
|
config_u_g_p* _config = (config_u_g_p*)vec_temp->pfVectorGet(vec_temp, i);
|
|
|
|
|
for (int j=0; j < vec_status_disk->vectorList.total;j++) {
|
|
|
|
|
disk_status* config_disk_status = (disk_status*)vec_status_disk->pfVectorGet(vec_status_disk, j);
|
|
|
|
|
if (strstr(config_disk_status->device, _config->UNIX_file) && strstr(config_disk_status->device, _config->type_arr) ) {
|
|
|
|
|
cmd = yon_char_unite(cmd, " ", save_format_status_cmd(config_disk_status, _config));
|
|
|
|
|
str_cmd_format = save_format_status_cmd(config_disk_status, _config);
|
|
|
|
|
if (str_cmd_format) {
|
|
|
|
|
cmd = yon_char_unite(cmd, " ", str_cmd_format, NULL);
|
|
|
|
|
free(cmd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -65,11 +70,16 @@ char* wrapper_save_format_status_cmd_all(config_all* _all_config) {
|
|
|
|
|
|
|
|
|
|
char* save_format_status_cmd(disk_status* config_disk_status, config_u_g_p* config) {
|
|
|
|
|
char* cmd = yon_char_unite("DISK_QUOTA[", config->type_arr, ":", config->UNIX_file,"]=", NULL);;
|
|
|
|
|
if (config_disk_status->status) {
|
|
|
|
|
if (config_disk_status->status == 1) {
|
|
|
|
|
cmd = yon_char_unite(cmd,"enable", NULL);
|
|
|
|
|
return cmd;
|
|
|
|
|
}
|
|
|
|
|
return yon_char_unite(cmd,"disable", NULL);
|
|
|
|
|
else if (config_disk_status->status == 0) {
|
|
|
|
|
return yon_char_unite(cmd,"disable", NULL);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char* wrapper_template_format_save(config_all* _all_config, char* source_set_cmd) {
|
|
|
|
|