Changeset 2383 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-files.c
- Timestamp:
- Sep 10, 2009, 2:55:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-files.c
r2382 r2383 274 274 char *kernel = NULL;; 275 275 276 mr_asprintf(kernel, "%s", call_program_and_get_last_line_of_output("mindi --findkernel 2> /dev/null"));276 kernel = call_program_and_get_last_line_of_output("mindi --findkernel 2> /dev/null"); 277 277 278 278 // If we didn't get anything back, check whether mindi raised a fatal error 279 279 if (!kernel[0]) { 280 280 mr_asprintf(command, "%s", "grep 'Fatal error' /var/log/mindi.log"); 281 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));281 tmp = call_program_and_get_last_line_of_output(command); 282 282 if (strlen(tmp) > 1) { 283 283 popup_and_OK(tmp); … … 331 331 assert_string_is_neither_NULL_nor_zerolength(fname); 332 332 mr_asprintf(command, "which %s 2> /dev/null", fname); 333 mr_asprintf(output, "%s", call_program_and_get_last_line_of_output(command));333 output = call_program_and_get_last_line_of_output(command); 334 334 mr_free(command); 335 335 if (output[0] == '\0') { … … 340 340 mr_asprintf(command, "file %s 2> /dev/null | cut -d':' -f1 2> /dev/null", output); 341 341 mr_free(output); 342 mr_asprintf(output, "%s", call_program_and_get_last_line_of_output(command));342 output = call_program_and_get_last_line_of_output(command); 343 343 mr_free(command); 344 344 } … … 346 346 mr_asprintf(command, "dirname %s 2> /dev/null", output); 347 347 mr_free(output); 348 mr_asprintf(output, "%s", call_program_and_get_last_line_of_output(command));348 output = call_program_and_get_last_line_of_output(command); 349 349 mr_free(command); 350 350 } … … 428 428 for (i = NOOF_ERR_LINES - 1; i >= 0 && !strstr(err_log_lines[i], "% Done") && !strstr(err_log_lines[i], "% done"); i--); 429 429 if (i < 0) { 430 mr_asprintf(command, "tail -n3 %s | grep -Fi \"%c\" | tail -n1 | awk '{print $0;}'", filename, '%');431 mr_asprintf(lastline, "%s", call_program_and_get_last_line_of_output(command));430 mr_asprintf(command, "tail -n3 %s | grep -Fi %% | tail -n1 | awk '{print $0;}'", filename); 431 lastline = call_program_and_get_last_line_of_output(command); 432 432 mr_free(command); 433 433 if (!lastline[0]) { … … 722 722 723 723 log_it(command); 724 mr_asprintf(sz_res, "%s", call_program_and_get_last_line_of_output(command));724 sz_res = call_program_and_get_last_line_of_output(command); 725 725 file_len_K = atol(sz_res); 726 726 log_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K); … … 779 779 mr_asprintf(command, "ntfsresize --force --info %s|grep '^You might resize at '|cut -d' ' -f5", fname); 780 780 log_it("command = %s", command); 781 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));781 tmp = call_program_and_get_last_line_of_output(command); 782 782 mr_free(command); 783 783 … … 1030 1030 } 1031 1031 1032 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output("which mondorestore"));1032 tmp = call_program_and_get_last_line_of_output("which mondorestore"); 1033 1033 if (!tmp[0]) { 1034 1034 mr_free(tmp); … … 1101 1101 /* BERLIOS : there is a bug #67 here as it only considers the first NIC */ 1102 1102 mr_asprintf(command, "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\n' | head -n1 | cut -d' ' -f1"); 1103 mr_asprintf(netfs_dev, "%s", call_program_and_get_last_line_of_output(command));1103 netfs_dev = call_program_and_get_last_line_of_output(command); 1104 1104 mr_free(command); 1105 1105 1106 1106 mr_asprintf(command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f7 | cut -d':' -f2"); 1107 mr_asprintf(netfs_client_ipaddr, "%s", call_program_and_get_last_line_of_output(command));1107 netfs_client_ipaddr = call_program_and_get_last_line_of_output(command); 1108 1108 mr_free(command); 1109 1109 1110 1110 mr_asprintf(command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f9 | cut -d':' -f2"); 1111 mr_asprintf(netfs_client_netmask, "%s", call_program_and_get_last_line_of_output(command));1111 netfs_client_netmask = call_program_and_get_last_line_of_output(command); 1112 1112 mr_free(command); 1113 1113 1114 1114 mr_asprintf(command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f8 | cut -d':' -f2"); 1115 mr_asprintf(netfs_client_broadcast, "%s", call_program_and_get_last_line_of_output(command));1115 netfs_client_broadcast = call_program_and_get_last_line_of_output(command); 1116 1116 mr_free(command); 1117 1117 1118 1118 mr_asprintf(command, "%s", "route -n | grep '^0.0.0.0' | awk '{print $2}'"); 1119 mr_asprintf(netfs_client_defgw, "%s", call_program_and_get_last_line_of_output(command));1119 netfs_client_defgw = call_program_and_get_last_line_of_output(command); 1120 1120 mr_free(command); 1121 1121 … … 1136 1136 log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", netfs_dev); 1137 1137 mr_asprintf(command, "%s", "ifconfig %s | awk '{print $5}' | head -n1", netfs_dev); 1138 m r_asprintf(mac_addr, "%s", call_program_and_get_last_line_of_output(command));1138 mac_addr = call_program_and_get_last_line_of_output(command); 1139 1139 mr_free(command); 1140 1140 … … 1143 1143 mr_free(netfs_dev); 1144 1144 1145 mr_asprintf(netfs_dev, "%s", call_program_and_get_last_line_of_output(command));1145 netfs_dev = call_program_and_get_last_line_of_output(command); 1146 1146 mr_free(command); 1147 1147
Note:
See TracChangeset
for help on using the changeset viewer.