Changeset 3610 in MondoRescue for branches/3.2/mondo/src/common/libmondo-files.c
- Timestamp:
- Nov 5, 2016, 6:12:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/common/libmondo-files.c
r3430 r3610 276 276 277 277 if (!kernel[0]) { 278 strcpy(kernel, call_program_and_get_last_line_of_output("mindi --findkernel 2> /dev/null")); 278 tmp = call_program_and_get_last_line_of_output("mindi --findkernel 2> /dev/null"); 279 strcpy(kernel, tmp); 280 mr_free(tmp); 279 281 } 280 282 // If we didn't get anything back, check whether mindi raised a fatal error 281 283 if (!kernel[0]) { 282 284 mr_asprintf(command, "grep 'Fatal error' %s", MINDI_LOGFILE); 283 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));285 tmp = call_program_and_get_last_line_of_output(command); 284 286 if (strlen(tmp) > 1) { 285 287 popup_and_OK(tmp); … … 334 336 assert_string_is_neither_NULL_nor_zerolength(fname); 335 337 mr_asprintf(command, "which %s 2> /dev/null", fname); 336 mr_asprintf(incoming, "%s", call_program_and_get_last_line_of_output(command));338 incoming = call_program_and_get_last_line_of_output(command); 337 339 mr_free(command); 338 340 … … 346 348 mr_free(incoming); 347 349 348 mr_asprintf(incoming, "%s", call_program_and_get_last_line_of_output(command));350 incoming = call_program_and_get_last_line_of_output(command); 349 351 mr_free(command); 350 352 } … … 353 355 mr_free(incoming); 354 356 355 mr_asprintf(incoming, "%s", call_program_and_get_last_line_of_output(command)); 357 mr_free(command); 358 incoming = call_program_and_get_last_line_of_output(command); 356 359 mr_free(command); 357 360 } … … 435 438 if (i < 0) { 436 439 mr_asprintf(command, "tail -n3 %s | grep -Fi \"%c\" | tail -n1 | awk '{print $0;}'", filename, '%'); 437 mr_asprintf(lastline, "%s", call_program_and_get_last_line_of_output(command));440 lastline = call_program_and_get_last_line_of_output(command); 438 441 mr_free(command); 439 442 if (!lastline[0]) { … … 730 733 731 734 log_it(command); 732 mr_asprintf(sz_res, "%s", call_program_and_get_last_line_of_output(command));735 sz_res = call_program_and_get_last_line_of_output(command); 733 736 file_len_K = atol(sz_res); 734 737 log_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K); … … 786 789 mr_asprintf(command, "ntfsresize --force --info %s|grep '^You might resize at '|cut -d' ' -f5", fname); 787 790 log_it("command = %s", command); 788 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));791 tmp = call_program_and_get_last_line_of_output(command); 789 792 mr_free(command); 790 793 … … 1059 1062 mr_free(command); 1060 1063 1061 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("which mondorestore"));1064 tmp = call_program_and_get_last_line_of_output("which mondorestore"); 1062 1065 if (!tmp[0]) { 1063 1066 mr_free(tmp); … … 1089 1092 1090 1093 mvaddstr_and_log_it(g_currentY++, 74, "Done."); 1091 }1092 1093 1094 /**1095 * Store the client's NETFS configuration in files to be restored at restore-time.1096 * Assumes that @c bkpinfo->media_type = netfs, but does not check for this.1097 * @param bkpinfo The backup information structure. Fields used:1098 * - @c netfs_mount1099 * - @c tmpdir1100 */1101 void store_netfs_config()1102 {1103 1104 /*@ buffers ******** */1105 char *netfs_dev = NULL;1106 char *netfs_client_hwaddr = NULL;1107 char *command = NULL;1108 1109 /********1110 * If the Network device found above is a bonded device,1111 * we need to replace it with an ethN device or the1112 * networking will not start during an Network restore.1113 *1114 * If the Network device in netfs_dev begins with the word "bond", or alb or aft1115 * look for the corresponding slave ethN device and copy it to netfs_dev.1116 * Using the common MAC address1117 ********/1118 if (!strncmp(netfs_dev, "bond", 4) || !strncmp(netfs_dev, "alb", 3) || !strncmp(netfs_dev, "aft", 3)) {1119 log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", netfs_dev);1120 mr_asprintf(command, "ifconfig | grep -E '%s' | grep -v '%s' | head -n1 | cut -d' ' -f1",netfs_client_hwaddr,netfs_dev);1121 mr_asprintf(netfs_dev, "%s", call_program_and_get_last_line_of_output(command));1122 mr_free(command);1123 log_to_screen("Replacing it with %s\n", netfs_dev);1124 }1125 1126 log_it("Finished storing Network configuration");1127 1094 } 1128 1095
Note:
See TracChangeset
for help on using the changeset viewer.