Changeset 2383 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-archive.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-archive.c
r2382 r2383 539 539 if (bkpinfo->exclude_paths) { 540 540 mr_asprintf(tmp, "echo '%s' | tr -s ' ' '\n' | grep -E '^/dev/.*$' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'", bkpinfo->exclude_paths); 541 mr_asprintf(devs_to_exclude, "%s", call_program_and_get_last_line_of_output(tmp));541 devs_to_exclude = call_program_and_get_last_line_of_output(tmp); 542 542 mr_free(tmp); 543 543 … … 626 626 627 627 #ifdef __FreeBSD__ 628 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'"));628 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'"); 629 629 if (!bootdev[0]) { 630 630 mr_free(bootdev); 631 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'"));631 bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'"); 632 632 } 633 633 #else 634 634 /* Linux */ 635 635 #ifdef __IA64__ 636 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"));636 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"); 637 637 #else 638 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"));638 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"); 639 639 #endif 640 640 if (strstr(bootdev, "/dev/cciss/")) { 641 641 mr_free(bootdev); 642 642 #ifdef __IA64__ 643 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1"));643 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1"); 644 644 #else 645 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1"));645 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1"); 646 646 #endif 647 647 } 648 648 if (!bootdev[0]) { 649 649 mr_free(bootdev); 650 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"));650 bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"); 651 651 if (strstr(bootdev, "/dev/cciss/")) { 652 652 mr_free(bootdev); 653 mr_asprintf(bootdev, "%s", call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1"));653 bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1"); 654 654 } 655 655 } … … 928 928 log_to_screen("Mindi failed to create your boot+data disks."); 929 929 mr_asprintf(command, "grep 'Fatal error' /var/log/mindi.log"); 930 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));930 tmp = call_program_and_get_last_line_of_output(command); 931 931 mr_free(command); 932 932 … … 1185 1185 mr_asprintf(data_disks_file, "%s/all.tar.gz", bkpinfo->tmpdir); 1186 1186 1187 mr_asprintf(g_serial_string, "%s", call_program_and_get_last_line_of_output("dd if=/dev/urandom bs=16 count=1 2> /dev/null | hexdump | tr -s ' ' '0' | head -n1"));1187 g_serial_string = call_program_and_get_last_line_of_output("dd if=/dev/urandom bs=16 count=1 2> /dev/null | hexdump | tr -s ' ' '0' | head -n1"); 1188 1188 mr_strip_spaces(g_serial_string); 1189 1189 mr_strcat(g_serial_string, "...word."); … … 1892 1892 mr_asprintf(command, "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1", bigfile_fname); 1893 1893 log_msg(1, "command = '%s'", command); 1894 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));1894 tmp = call_program_and_get_last_line_of_output(command); 1895 1895 mr_free(command); 1896 1896 … … 2660 2660 mr_asprintf(tmp, "cat %s 2> /dev/null", szserfname); 2661 2661 mr_free(our_serial_str); 2662 mr_asprintf(our_serial_str, "%s", call_program_and_get_last_line_of_output(tmp));2662 our_serial_str = call_program_and_get_last_line_of_output(tmp); 2663 2663 mr_free(tmp); 2664 2664 // FIXME - should be able to use last_line_of_file(), surely? … … 2859 2859 mr_asprintf(command, "ntfsresize --force --info %s|grep '^You might resize at '|cut -d' ' -f5", biggie_filename); 2860 2860 log_it("command = %s", command); 2861 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));2861 tmp = call_program_and_get_last_line_of_output(command); 2862 2862 mr_free(command); 2863 2863 log_it("res of it = %s", tmp);
Note:
See TracChangeset
for help on using the changeset viewer.