Changeset 2704 in MondoRescue
- Timestamp:
- Jan 27, 2011, 7:31:24 PM (14 years ago)
- Location:
- branches/2.2.10
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mindi/mindi
r2696 r2704 1413 1413 if [ "$ARCH" != "ia64" ] ; then 1414 1414 if [ _"$MONDO_SHARE" != _"" ]; then 1415 cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"1415 cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_CACHE 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_CACHE). Did you run out of disk space?" 1416 1416 if [ $KERNEL_IS_XEN = "yes" ]; then 1417 cp -f $MINDI_TMP/iso/{mboot.c32,xen.gz} $MONDO_ ROOT 2>> $LOGFILE || Die "Cannot copy Xen core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"1417 cp -f $MINDI_TMP/iso/{mboot.c32,xen.gz} $MONDO_CACHE 2>> $LOGFILE || Die "Cannot copy Xen core files to ramdisk for boot disk (under $MONDO_CACHE). Did you run out of disk space?" 1418 1418 fi 1419 1419 cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE … … 2311 2311 done 2312 2312 2313 rm -f $MINDI_TMP/ungzip.lis2314 2313 for i in `echo $needed_modules | tr ' ' '\n' | sort -u`; do 2315 2314 grep -qE '^$i$' $MINDI_TMP/cp.lis … … 2318 2317 LogFile "Adding $i ($s KB) to the rootfs" 2319 2318 echo $i >> $MINDI_TMP/cp.lis 2320 2321 # Uncompress modules if not using udev and native modprobe2322 if [ ! -f $mountpoint/tmp/USE-UDEV ]; then2323 if [ "`echo "$i" | grep -F ".gz"`" ]; then2324 echo "$i" >> $MINDI_TMP/ungzip.lis2325 fi2326 fi2327 2319 fi 2328 2320 done … … 2340 2332 # Copy FW in case some drivers needs it 2341 2333 if [ -d "/lib/firmware" ]; then 2342 cp -rp /lib/firmware $mountpoint/lib 2334 echo "lib/firmware" >> $MINDI_TMP/mkdir.lis 2335 echo "/lib/firmware" >> $MINDI_TMP/cp.lis 2343 2336 fi 2344 2337 … … 2380 2373 # Then copy files needed 2381 2374 LANGUAGE=C tar cf - `cat $MINDI_TMP/cp.lis` 2> /dev/null | (cd $mountpoint ; tar xf - ) 2>&1 | grep -Ev "tar: Removing.*/\'" >> $LOGFILE 2382 2383 # Uncompress modules if not using udev and native modprobe2384 for f in `cat $MINDI_TMP/ungzip.lis`; do2385 echo "Uncompressing $f" >> $LOGFILE2386 gunzip -f $mountpoint/$f2387 done2388 rm -f $MINDI_TMP/ungzip.lis2389 2375 2390 2376 # Then handle links … … 2490 2476 LogFile "Start date : `date`" 2491 2477 LogFile "-----------------------------" 2492 2493 # TODO: Remove that2494 [ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat2495 2478 2496 2479 # Log some capital variables … … 2630 2613 LogFile "-------------" 2631 2614 LogFile "Liste of extra modules is:" 2615 LogFile "-------------" 2632 2616 LogFile "$EXTRA_MODS" 2633 2617 LogFile "-------------" … … 2718 2702 Die "MONDO_TMP is /, aborting" 2719 2703 fi 2720 mv $MINDI_TMP/* $MINDI_TMP/.??* $MONDO_TMP 2>> $LOGFILE2721 2704 rmdir $MINDI_TMP 2722 2705 export MINDI_TMP=$MONDO_TMP -
branches/2.2.10/mondo/src/common/libmondo-archive.c
r2644 r2704 612 612 613 613 #ifdef __FreeBSD__ 614 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'" );614 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'",TRUE); 615 615 if (!bootdev[0]) { 616 616 mr_free(bootdev); 617 bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'" );617 bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'",TRUE); 618 618 } 619 619 #else 620 620 /* Linux */ 621 621 #ifdef __IA64__ 622 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'" );622 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'",TRUE); 623 623 #else 624 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'" );624 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'",TRUE); 625 625 #endif 626 626 if (strstr(bootdev, "/dev/cciss/")) { 627 627 mr_free(bootdev); 628 628 #ifdef __IA64__ 629 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1" );629 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1",TRUE); 630 630 #else 631 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1" );631 bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1",TRUE); 632 632 #endif 633 633 } 634 634 if (!bootdev[0]) { 635 635 mr_free(bootdev); 636 bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'" );636 bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'",TRUE); 637 637 if (strstr(bootdev, "/dev/cciss/")) { 638 638 mr_free(bootdev); 639 bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1" );639 bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1",TRUE); 640 640 } 641 641 } … … 840 840 if (!res) { 841 841 log_to_screen("Boot+data disks were created OK"); 842 mr_asprintf(command, "cp -f /%s/ images/mindi.iso %s/mondorescue.iso", MINDI_CACHE_REL, MINDI_CACHE);842 mr_asprintf(command, "cp -f /%s/mindi.iso %s/mondorescue.iso", MINDI_CACHE_REL, MINDI_CACHE); 843 843 log_msg(2, command); 844 844 run_program_and_log_output(command, FALSE); … … 866 866 log_to_screen("Mindi failed to create your boot+data disks."); 867 867 mr_asprintf(command, "grep 'Fatal error' /var/log/mindi.log"); 868 tmp = call_program_and_get_last_line_of_output(command );868 tmp = call_program_and_get_last_line_of_output(command,TRUE); 869 869 mr_free(command); 870 870 … … 1125 1125 mr_asprintf(data_disks_file, "/%s/all.tar.gz", MINDI_CACHE_REL); 1126 1126 1127 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" );1127 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",TRUE); 1128 1128 mr_strip_spaces(g_serial_string); 1129 1129 mr_strcat(g_serial_string, "...word."); … … 1811 1811 mr_asprintf(command, "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1", bigfile_fname); 1812 1812 log_msg(1, "command = '%s'", command); 1813 tmp = call_program_and_get_last_line_of_output(command );1813 tmp = call_program_and_get_last_line_of_output(command,TRUE); 1814 1814 mr_free(command); 1815 1815 … … 2544 2544 mr_asprintf(tmp, "cat %s 2> /dev/null", szserfname); 2545 2545 mr_free(our_serial_str); 2546 our_serial_str = call_program_and_get_last_line_of_output(tmp );2546 our_serial_str = call_program_and_get_last_line_of_output(tmp,TRUE); 2547 2547 mr_free(tmp); 2548 2548 // FIXME - should be able to use last_line_of_file(), surely? … … 2733 2733 mr_asprintf(command, "ntfsresize --force --info %s|grep '^You might resize at '|cut -d' ' -f5", biggie_filename); 2734 2734 log_it("command = %s", command); 2735 tmp = call_program_and_get_last_line_of_output(command );2735 tmp = call_program_and_get_last_line_of_output(command,TRUE); 2736 2736 mr_free(command); 2737 2737 log_it("res of it = %s", tmp); -
branches/2.2.10/mondo/src/common/libmondo-cli.c
r2696 r2704 490 490 mr_asprintf(tmp1, "mount | grep -E \"^[%s@]*%s[/]* .*\" | cut -d' ' -f3", bkpinfo->netfs_user, bkpinfo->netfs_mount); 491 491 mr_free(bkpinfo->isodir); 492 bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp1 );492 bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp1,TRUE); 493 493 mr_free(tmp1); 494 494 … … 511 511 mr_asprintf(tmp1, "mount | grep -E \"^[%s@]*%s[/]* .*\" | cut -d' ' -f3", bkpinfo->netfs_user, bkpinfo->netfs_mount); 512 512 mr_free(bkpinfo->isodir); 513 bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp1 );513 bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp1,TRUE); 514 514 mr_free(tmp1); 515 515 -
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2696 r2704 532 532 if (tmp1) { 533 533 mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep CD | cut -d' ' -f2 | head -n1", cdr_exe); 534 tmp = call_program_and_get_last_line_of_output(command );534 tmp = call_program_and_get_last_line_of_output(command,TRUE); 535 535 mr_free(command); 536 536 } … … 812 812 813 813 log_msg(1, "command=%s", command); 814 tmp = call_program_and_get_last_line_of_output(command );814 tmp = call_program_and_get_last_line_of_output(command,TRUE); 815 815 mr_free(command); 816 816 … … 840 840 } 841 841 842 tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1" );842 tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1",TRUE); 843 843 log_msg(5, "tmp = '%s'", tmp); 844 844 if (!tmp[0]) 845 845 mr_free(tmp); 846 tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1" );846 tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1",TRUE); 847 847 if (tmp[0]) { 848 848 devno = atoi(tmp) - 1; … … 1107 1107 int i = 2; 1108 1108 1109 tmp = call_program_and_get_last_line_of_output("/sbin/sysctl -n kern.osreldate" );1109 tmp = call_program_and_get_last_line_of_output("/sbin/sysctl -n kern.osreldate",TRUE); 1110 1110 i = atoi(tmp); 1111 1111 mr_free(tmp); … … 1122 1122 } else { 1123 1123 sprintf(command, "mdconfig -a -t vnode -f %s", fname); 1124 mddevice = call_program_and_get_last_line_of_output(command );1124 mddevice = call_program_and_get_last_line_of_output(command,TRUE); 1125 1125 if (!strstr(mddevice, "md")) { 1126 1126 return NULL; … … 1152 1152 } 1153 1153 1154 tmp = call_program_and_get_last_line_of_output("/sbin/sysctl -n kern.osreldate" ));1154 tmp = call_program_and_get_last_line_of_output("/sbin/sysctl -n kern.osreldate",TRUE); 1155 1155 i = atoi(tmp); 1156 1156 mr_free(tmp); … … 1583 1583 mr_asprintf(command, "mount 2>/dev/null | awk '{if($1 ~ \"^/dev/\"){print $0}}'|wc -l"); 1584 1584 log_msg(5, "Running: %s", command); 1585 mounted_file_system = call_program_and_get_last_line_of_output(command );1585 mounted_file_system = call_program_and_get_last_line_of_output(command,TRUE); 1586 1586 mr_free(command); 1587 1587 … … 1593 1593 mr_asprintf(command, "mount 2>/dev/null | awk '{if($1 ~ \"^/dev/\"){print $1,$3}}'|head -n %d", i); 1594 1594 log_msg(5, "Running: %s", command); 1595 mounted_file_system = call_program_and_get_last_line_of_output(command );1595 mounted_file_system = call_program_and_get_last_line_of_output(command,TRUE); 1596 1596 mr_free(command); 1597 1597 … … 1673 1673 mr_asprintf(command, "ls -al %s 2>/dev/null | wc -l", dsf); 1674 1674 log_msg(5, " Executing: %s", command); 1675 tmp = call_program_and_get_last_line_of_output(command );1675 tmp = call_program_and_get_last_line_of_output(command,TRUE); 1676 1676 mr_free(command); 1677 1677 … … 1699 1699 mr_asprintf(command, "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf); 1700 1700 log_msg(5, "Executing: %s", command); 1701 partition_list = call_program_and_get_last_line_of_output(command );1701 partition_list = call_program_and_get_last_line_of_output(command,TRUE); 1702 1702 mr_free(command); 1703 1703 … … 1767 1767 mr_asprintf(command, "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'", ndsf, partitions[i]); 1768 1768 log_msg(5, " Running: %s", command); 1769 tmp = call_program_and_get_last_line_of_output(command );1769 tmp = call_program_and_get_last_line_of_output(command,TRUE); 1770 1770 mr_free(command); 1771 1771 … … 1781 1781 /* It's not swap. See if we can find the mount point from the mount command. */ 1782 1782 mr_asprintf(command, "mount 2>/dev/null | awk '{if((NF>0)&&($1==\"%s\")){print $3}}'", partitions[i]); 1783 tmp = call_program_and_get_last_line_of_output(command );1783 tmp = call_program_and_get_last_line_of_output(command,TRUE); 1784 1784 mr_free(command); 1785 1785 … … 1803 1803 mr_asprintf(command, "pvdisplay -c %s | grep '%s:' 2> /dev/null", partitions[i], partitions[i]); 1804 1804 log_msg(5, " Running: %s", command); 1805 tmp = call_program_and_get_last_line_of_output(command );1805 tmp = call_program_and_get_last_line_of_output(command,TRUE); 1806 1806 mr_free(command); 1807 1807 … … 1811 1811 mr_asprintf(command, "pvdisplay -v %s 2>/dev/null|grep \"VG Name\"|awk '{print $NF}'", partitions[i]); 1812 1812 log_msg(5, " Running: %s", command); 1813 strcpy(VG, call_program_and_get_last_line_of_output(command ));1813 strcpy(VG, call_program_and_get_last_line_of_output(command,TRUE)); 1814 1814 mr_free(command); 1815 1815 … … 1820 1820 mr_asprintf(command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", VG, VG); 1821 1821 log_msg(5, " Running: %s", command); 1822 mr_asprintf(mount_list, "%s", call_program_and_get_last_line_of_output(command ));1822 mr_asprintf(mount_list, "%s", call_program_and_get_last_line_of_output(command,TRUE)); 1823 1823 mr_free(command); 1824 1824 … … 1844 1844 mr_asprintf(command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 1845 1845 log_msg (5, "Running: %s", command); 1846 mr_asprintf(mount_list, "%s", call_program_and_get_last_line_of_output(command ));1846 mr_asprintf(mount_list, "%s", call_program_and_get_last_line_of_output(command,TRUE)); 1847 1847 mr_free(command); 1848 1848 … … 1853 1853 log_msg (5, "Running: %s", command); 1854 1854 mr_free(tmp); 1855 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command ));1855 mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command,TRUE)); 1856 1856 mr_free(command); 1857 1857 … … 1889 1889 mr_asprintf(command, "mdadm --examine %s 2>/dev/null | awk '{if($1 == \"UUID\"){print $3}}'", partitions[i]); 1890 1890 log_msg(4, " Running: %s", command); 1891 tmp = call_program_and_get_last_line_of_output(command );1891 tmp = call_program_and_get_last_line_of_output(command,TRUE); 1892 1892 mr_free(command); 1893 1893 … … 1902 1902 mr_asprintf(command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 1903 1903 log_msg (5, " Running: %s", command); 1904 mount_list = call_program_and_get_last_line_of_output(command );1904 mount_list = call_program_and_get_last_line_of_output(command,TRUE); 1905 1905 mr_free(command); 1906 1906 … … 1913 1913 mr_free(tmp); 1914 1914 1915 tmp = call_program_and_get_last_line_of_output(command );1915 tmp = call_program_and_get_last_line_of_output(command,TRUE); 1916 1916 mr_free(command); 1917 1917 … … 2076 2076 2077 2077 mr_asprintf(exclude_these_directories,"%s",list_of_NETFS_mounts_only()); 2078 exclude_these_devices = call_program_and_get_last_line_of_output("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|sshfs|nfs|nfs4|smbfs|cifs|afs|gfs|ocfs|ocfs2|mvfs|nsspool|nsvol) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'" );2078 exclude_these_devices = call_program_and_get_last_line_of_output("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|sshfs|nfs|nfs4|smbfs|cifs|afs|gfs|ocfs|ocfs2|mvfs|nsspool|nsvol) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'",TRUE); 2079 2079 snprintf(result_sz, 1023, "%s %s", exclude_these_directories, exclude_these_devices); 2080 2080 mr_free(exclude_these_devices); … … 2097 2097 static char result_sz[512]; 2098 2098 2099 exclude_these_directories = call_program_and_get_last_line_of_output("mount -t coda,ncpfs,fuse.sshfs,nfs,nfs4,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'" );2099 exclude_these_directories = call_program_and_get_last_line_of_output("mount -t coda,ncpfs,fuse.sshfs,nfs,nfs4,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'",TRUE); 2100 2100 snprintf(result_sz, 511, "%s", exclude_these_directories); 2101 2101 mr_free(exclude_these_directories); … … 2149 2149 2150 2150 #ifdef __FreeBSD__ 2151 tmp = call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -t nonfs,msdosfs,ntfs,ntfs-3g,smbfs,smb,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;} | while read x ; do test -w $x && echo $x && break ; done'" );2151 tmp = call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -t nonfs,msdosfs,ntfs,ntfs-3g,smbfs,smb,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;} | while read x ; do test -w $x && echo $x && break ; done'",TRUE); 2152 2152 #else 2153 tmp = call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -x nfs -x nfs4 -x fuse.sshfs -x fuse -x vfat -x ntfs -x ntfs-3g -x smbfs -x smb -x cifs -x afs -x gfs -x ocfs -x ocfs2 -x mvfs -x nsspool -x nssvol -x iso9660 | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}' | while read x ; do test -w $x && echo $x && break ; done" );2153 tmp = call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -x nfs -x nfs4 -x fuse.sshfs -x fuse -x vfat -x ntfs -x ntfs-3g -x smbfs -x smb -x cifs -x afs -x gfs -x ocfs -x ocfs2 -x mvfs -x nsspool -x nssvol -x iso9660 | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}' | while read x ; do test -w $x && echo $x && break ; done",TRUE); 2154 2154 #endif 2155 2155 … … 2245 2245 if (g_ISO_restore_mode) { 2246 2246 mr_asprintf(tmp, "mount | grep iso9660 | awk '{print $3;}'"); 2247 mountdev = call_program_and_get_last_line_of_output(tmp );2247 mountdev = call_program_and_get_last_line_of_output(tmp,TRUE); 2248 2248 mr_strcat(mountdev, "/archives/THIS-CD-NUMBER"); 2249 2249 mr_free(tmp); … … 2299 2299 2300 2300 #ifdef __FreeBSD__ 2301 output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1" );2301 output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1",TRUE); 2302 2302 #else 2303 output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1 | sed 's/[0-9]//' | sed 's/[0-9]//'" );2303 output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1 | sed 's/[0-9]//' | sed 's/[0-9]//'",TRUE); 2304 2304 if (strstr(output, "/dev/cciss/")) { 2305 2305 mr_free(output); 2306 output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1 | cut -dp -f1" );2306 output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1 | cut -dp -f1",TRUE); 2307 2307 } 2308 2308 if (strstr(output, "/dev/md")) { 2309 2309 mr_free(output); 2310 output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1" );2310 output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1",TRUE); 2311 2311 } 2312 2312 #endif … … 2546 2546 log_msg(1, "curr_fname = %s", curr_fname); 2547 2547 mr_asprintf(command, "file %s", curr_fname); 2548 tmp = call_program_and_get_last_line_of_output(command );2548 tmp = call_program_and_get_last_line_of_output(command,TRUE); 2549 2549 mr_free(command); 2550 2550 for (p = tmp + strlen(tmp); p != tmp && *p != '`' && *p != ' '; p--); … … 2596 2596 mr_free(fdisk); 2597 2597 2598 tmp = call_program_and_get_last_line_of_output(command );2598 tmp = call_program_and_get_last_line_of_output(command,TRUE); 2599 2599 mr_free(command); 2600 2600 … … 2874 2874 /* Initiate bkpinfo netfs_mount path from running environment if not already done */ 2875 2875 if (bkpinfo->netfs_mount == NULL) { 2876 bkpinfo->netfs_mount = call_program_and_get_last_line_of_output("mount | grep \":\" | cut -d' ' -f1 | head -n1" );2876 bkpinfo->netfs_mount = call_program_and_get_last_line_of_output("mount | grep \":\" | cut -d' ' -f1 | head -n1",TRUE); 2877 2877 } 2878 2878 #ifdef __FreeBSD__ … … 2903 2903 mr_asprintf(command, "mount | grep \"%s \" | cut -d' ' -f3", bkpinfo->netfs_mount); 2904 2904 mr_free(bkpinfo->isodir); 2905 bkpinfo->isodir = call_program_and_get_last_line_of_output(command );2905 bkpinfo->isodir = call_program_and_get_last_line_of_output(command,TRUE); 2906 2906 mr_free(command); 2907 2907 … … 2953 2953 mr_free(bkpinfo->isodir); 2954 2954 if (is_this_device_mounted(bkpinfo->netfs_mount)) { 2955 bkpinfo->isodir = call_program_and_get_last_line_of_output("mount | grep \":\" | cut -d' ' -f3 | head -n1" );2955 bkpinfo->isodir = call_program_and_get_last_line_of_output("mount | grep \":\" | cut -d' ' -f3 | head -n1",TRUE); 2956 2956 2957 2957 } else { … … 3060 3060 #ifdef __FreeBSD__ 3061 3061 #define EXAMPLEBD "/dev/ad0" 3062 bkpinfo->boot_device = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'" );3062 bkpinfo->boot_device = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'",TRUE); 3063 3063 #else 3064 3064 #define EXAMPLEBD "/dev/hda" 3065 bkpinfo->boot_device = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'" );3065 bkpinfo->boot_device = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'",TRUE); 3066 3066 #endif 3067 3067 i = which_boot_loader(bkpinfo->boot_device); … … 3120 3120 mr_free(tmp); 3121 3121 // NTFS 3122 tmp = call_program_and_get_last_line_of_output("parted2fdisk -l | grep -i ntfs | awk '{ print $1};' | tr -s '\\n' ' ' | awk '{ print $0};'" );3122 tmp = call_program_and_get_last_line_of_output("parted2fdisk -l | grep -i ntfs | awk '{ print $1};' | tr -s '\\n' ' ' | awk '{ print $0};'",TRUE); 3123 3123 if (strlen(tmp) > 2) { 3124 3124 p = popup_and_get_string("NTFS partitions", "Please enter/confirm the NTFS partitions you wish to backup as well.", tmp); -
branches/2.2.10/mondo/src/common/libmondo-fifo.c
r2508 r2704 165 165 mr_asprintf(command, "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer); 166 166 log_msg(2, "kill_buffer() --- command = %s", command); 167 tmp = call_program_and_get_last_line_of_output(command );167 tmp = call_program_and_get_last_line_of_output(command,TRUE); 168 168 mr_free(command); 169 169 -
branches/2.2.10/mondo/src/common/libmondo-filelist.c
r2696 r2704 874 874 log_msg(6, "tmp = %s", tmp); 875 875 876 tmp1 = call_program_and_get_last_line_of_output(tmp );876 tmp1 = call_program_and_get_last_line_of_output(tmp,TRUE); 877 877 mr_free(tmp); 878 878 … … 1377 1377 1378 1378 mr_asprintf(tmp, "wc -l %s | awk '{print $1;}'", g_skeleton_filelist); 1379 tmp1 = call_program_and_get_last_line_of_output(tmp );1379 tmp1 = call_program_and_get_last_line_of_output(tmp,TRUE); 1380 1380 mr_free(tmp); 1381 1381 … … 1545 1545 } 1546 1546 make_hole_for_file(sz_datefile); 1547 tmp1 = call_program_and_get_last_line_of_output("date +%s" );1547 tmp1 = call_program_and_get_last_line_of_output("date +%s",TRUE); 1548 1548 write_one_liner_data_file(sz_datefile, tmp1); 1549 1549 mr_free(tmp1); … … 1572 1572 } 1573 1573 log_msg(1, "Calculating filelist"); 1574 tmp2 = call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|ntfs-3g|fat|vfat|dos' | awk '{print $3}'" );1574 tmp2 = call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|ntfs-3g|fat|vfat|dos' | awk '{print $3}'",TRUE); 1575 1575 if (strlen(tmp2) < 1) { 1576 1576 mr_asprintf(tmp1," "); … … 1579 1579 mr_asprintf(tmp1, "find %s -name '/win386.swp' -o -name '/hiberfil.sys' -o -name '/pagefile.sys' 2> /dev/null\n",tmp2); 1580 1580 mr_free(tmp2); 1581 tmp2 = call_program_and_get_last_line_of_output(tmp1 );1581 tmp2 = call_program_and_get_last_line_of_output(tmp1,TRUE); 1582 1582 log_msg(2, "Found windows files: %s",tmp2); 1583 1583 } -
branches/2.2.10/mondo/src/common/libmondo-files.c
r2623 r2704 274 274 char *kernel = NULL;; 275 275 276 kernel = 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",TRUE); 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 tmp = call_program_and_get_last_line_of_output(command );281 tmp = call_program_and_get_last_line_of_output(command,TRUE); 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 output = call_program_and_get_last_line_of_output(command );333 output = call_program_and_get_last_line_of_output(command,TRUE); 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 output = call_program_and_get_last_line_of_output(command );342 output = call_program_and_get_last_line_of_output(command,TRUE); 343 343 mr_free(command); 344 344 } … … 346 346 mr_asprintf(command, "dirname %s 2> /dev/null", output); 347 347 mr_free(output); 348 output = call_program_and_get_last_line_of_output(command );348 output = call_program_and_get_last_line_of_output(command,TRUE); 349 349 mr_free(command); 350 350 } … … 429 429 if (i < 0) { 430 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 );431 lastline = call_program_and_get_last_line_of_output(command,FALSE); 432 432 mr_free(command); 433 433 if (!lastline[0]) { … … 722 722 723 723 log_it(command); 724 sz_res = call_program_and_get_last_line_of_output(command );724 sz_res = call_program_and_get_last_line_of_output(command,TRUE); 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 tmp = call_program_and_get_last_line_of_output(command );781 tmp = call_program_and_get_last_line_of_output(command,TRUE); 782 782 mr_free(command); 783 783 … … 1022 1022 } 1023 1023 1024 tmp = call_program_and_get_last_line_of_output("which mondorestore" );1024 tmp = call_program_and_get_last_line_of_output("which mondorestore",TRUE); 1025 1025 if (!tmp[0]) { 1026 1026 mr_free(tmp); … … 1093 1093 /* BERLIOS : there is a bug #67 here as it only considers the first NIC */ 1094 1094 mr_asprintf(command, "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\n' | head -n1 | cut -d' ' -f1"); 1095 netfs_dev = call_program_and_get_last_line_of_output(command );1095 netfs_dev = call_program_and_get_last_line_of_output(command,TRUE); 1096 1096 mr_free(command); 1097 1097 1098 1098 mr_asprintf(command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f7 | cut -d':' -f2"); 1099 netfs_client_ipaddr = call_program_and_get_last_line_of_output(command );1099 netfs_client_ipaddr = call_program_and_get_last_line_of_output(command,TRUE); 1100 1100 mr_free(command); 1101 1101 1102 1102 mr_asprintf(command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f9 | cut -d':' -f2"); 1103 netfs_client_netmask = call_program_and_get_last_line_of_output(command );1103 netfs_client_netmask = call_program_and_get_last_line_of_output(command,TRUE); 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' ' -f8 | cut -d':' -f2"); 1107 netfs_client_broadcast = call_program_and_get_last_line_of_output(command );1107 netfs_client_broadcast = call_program_and_get_last_line_of_output(command,TRUE); 1108 1108 mr_free(command); 1109 1109 1110 1110 mr_asprintf(command, "%s", "route -n | grep '^0.0.0.0' | awk '{print $2}'"); 1111 netfs_client_defgw = call_program_and_get_last_line_of_output(command );1111 netfs_client_defgw = call_program_and_get_last_line_of_output(command,TRUE); 1112 1112 mr_free(command); 1113 1113 … … 1128 1128 log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", netfs_dev); 1129 1129 mr_asprintf(command, "%s", "ifconfig %s | awk '{print $5}' | head -n1", netfs_dev); 1130 mac_addr = call_program_and_get_last_line_of_output(command );1130 mac_addr = call_program_and_get_last_line_of_output(command,TRUE); 1131 1131 mr_free(command); 1132 1132 … … 1135 1135 mr_free(netfs_dev); 1136 1136 1137 netfs_dev = call_program_and_get_last_line_of_output(command );1137 netfs_dev = call_program_and_get_last_line_of_output(command,TRUE); 1138 1138 mr_free(command); 1139 1139 -
branches/2.2.10/mondo/src/common/libmondo-fork-EXT.h
r2339 r2704 1 1 /* libmondo-fork-EXT.h */ 2 2 3 extern char *call_program_and_get_last_line_of_output(char *call );3 extern char *call_program_and_get_last_line_of_output(char *call, bool logit); 4 4 extern int run_program_and_log_to_screen(char *basic_call, 5 5 char *what_i_am_doing); -
branches/2.2.10/mondo/src/common/libmondo-fork.c
r2696 r2704 35 35 * @note The returned value points to an allocated string that the caller needs to free 36 36 */ 37 char *call_program_and_get_last_line_of_output(char *call )37 char *call_program_and_get_last_line_of_output(char *call, bool logit) 38 38 { 39 39 /*@ buffers ***************************************************** */ … … 52 52 mr_asprintf(tmpf, "%s/cpgll.out", bkpinfo->tmpdir); 53 53 mr_asprintf(newcall, "%s > %s", call, tmpf); 54 log_msg(4, "Calling command: %s", newcall); 54 if (logit) { 55 log_msg(4, "Calling command: %s", newcall); 56 } 55 57 /* By default return an empty string in any case */ 56 58 mr_asprintf(result, ""); … … 73 75 mr_free(tmp); 74 76 } 75 log_msg(9, "Pre-Result: %s", result); 77 if (logit) { 78 log_msg(9, "Pre-Result: %s", result); 79 } 76 80 mr_strip_spaces(result); 77 81 paranoid_pclose(fin); … … 80 84 } 81 85 mr_free(tmpf); 82 log_msg(4, "Result: %s", result); 86 if (logit) { 87 log_msg(4, "Result: %s", result); 88 } 83 89 return(result); 84 90 } -
branches/2.2.10/mondo/src/common/libmondo-fork.h
r2339 r2704 5 5 6 6 7 char *call_program_and_get_last_line_of_output(char *call );7 char *call_program_and_get_last_line_of_output(char *call, bool logit); 8 8 int run_program_and_log_to_screen(char *basic_call, char *what_i_am_doing); 9 9 int run_program_and_log_output(char *program, int); -
branches/2.2.10/mondo/src/common/libmondo-stream.c
r2462 r2704 265 265 266 266 mr_asprintf(command, "%s -scanbus 2> /dev/null | grep -i tape | wc -l", cdr_exe); 267 tmp = call_program_and_get_last_line_of_output(command );267 tmp = call_program_and_get_last_line_of_output(command,TRUE); 268 268 mr_free(command); 269 269 … … 277 277 278 278 mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1", cdr_exe); 279 tmp = call_program_and_get_last_line_of_output(command );279 tmp = call_program_and_get_last_line_of_output(command,TRUE); 280 280 mr_free(command); 281 281 … … 289 289 mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1", cdr_exe); 290 290 mr_free(cdr_exe); 291 tmp = call_program_and_get_last_line_of_output(command );291 tmp = call_program_and_get_last_line_of_output(command,TRUE); 292 292 mr_free(command); 293 293 … … 324 324 } 325 325 326 tmp = call_program_and_get_last_line_of_output(" cdrecord -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | awk '{for(i=1; i<NF; i++) { if (index($i, \"GB\")>0) { print $i;};};};'" );326 tmp = call_program_and_get_last_line_of_output(" cdrecord -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | awk '{for(i=1; i<NF; i++) { if (index($i, \"GB\")>0) { print $i;};};};'",TRUE); 327 327 328 328 if (mt_says_tape_exists(dev)) { -
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2696 r2704 225 225 d = 5.2; // :-) 226 226 #else 227 tmp = call_program_and_get_last_line_of_output("uname -r" );227 tmp = call_program_and_get_last_line_of_output("uname -r",TRUE); 228 228 p = strchr(tmp, '.'); 229 229 if (p) { … … 476 476 if (getenv ("SUDO_COMMAND")) { 477 477 mr_asprintf(command, "strings `which growisofs` | grep -c SUDO_COMMAND"); 478 tmp = call_program_and_get_last_line_of_output(command );478 tmp = call_program_and_get_last_line_of_output(command,TRUE); 479 479 if (!strcmp(tmp, "1")) { 480 480 mr_free(command); … … 575 575 mr_asprintf(command, "df -P %s | tail -n1 | cut -d' ' -f1", bkpinfo->isodir); 576 576 log_it("command = %s", command); 577 iso_dev = call_program_and_get_last_line_of_output(command );577 iso_dev = call_program_and_get_last_line_of_output(command,TRUE); 578 578 log_it("res of it = %s", iso_dev); 579 579 mr_free(command); … … 583 583 584 584 log_it("command = %s", command); 585 iso_mnt = call_program_and_get_last_line_of_output(command );585 iso_mnt = call_program_and_get_last_line_of_output(command,TRUE); 586 586 log_it("res of it = %s", iso_mnt); 587 587 mr_free(command); … … 858 858 859 859 mr_asprintf(command, "df -m -P %s | tail -n1 | tr -s ' ' '\t' | cut -f4", partition); 860 out_sz = call_program_and_get_last_line_of_output(command );860 out_sz = call_program_and_get_last_line_of_output(command,TRUE); 861 861 mr_free(command); 862 862 … … 900 900 run_program_and_log_output("ln -sf `which mkfs.msdos` /sbin/mkfs.vfat", FALSE); 901 901 } 902 tmp = call_program_and_get_last_line_of_output("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2" );902 tmp = call_program_and_get_last_line_of_output("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2",TRUE); 903 903 if (atol(tmp) < 35000) { 904 904 retval++; … … 961 961 962 962 run_program_and_log_output("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5); 963 tmp = call_program_and_get_last_line_of_output("mount | grep -E \"cdr(om|w)\"" );963 tmp = call_program_and_get_last_line_of_output("mount | grep -E \"cdr(om|w)\"",TRUE); 964 964 if (strcmp("", tmp)) { 965 965 if (strstr(tmp, "autofs")) { … … 1046 1046 } else { 1047 1047 mr_asprintf(command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", label, config_file); 1048 value = call_program_and_get_last_line_of_output(command );1048 value = call_program_and_get_last_line_of_output(command,TRUE); 1049 1049 mr_free(command); 1050 1050 … … 1175 1175 mr_asprintf(command, "%s", "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1176 1176 log_msg(4, "Cool. Command = '%s'", command); 1177 tmp = call_program_and_get_last_line_of_output(command );1177 tmp = call_program_and_get_last_line_of_output(command,TRUE); 1178 1178 mr_free(command); 1179 1179 … … 1182 1182 mr_asprintf(command, "mount | grep -Ew '/boot'"); 1183 1183 mr_free(tmp); 1184 tmp = call_program_and_get_last_line_of_output(command );1184 tmp = call_program_and_get_last_line_of_output(command,TRUE); 1185 1185 mr_free(command); 1186 1186 … … 1381 1381 char *tmp = NULL; 1382 1382 1383 tmp = call_program_and_get_last_line_of_output("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99" );1383 tmp = call_program_and_get_last_line_of_output("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99",TRUE); 1384 1384 1385 1385 strcpy(g_magicdev_command, tmp); -
branches/2.2.10/mondo/src/mondorestore/mondo-prep.c
r2623 r2704 213 213 #endif 214 214 215 tmp = call_program_and_get_last_line_of_output("cat "CMDLINE );215 tmp = call_program_and_get_last_line_of_output("cat "CMDLINE,TRUE); 216 216 if (strstr(tmp, "nolvm")) { 217 217 mr_free(tmp); … … 336 336 if (lvmversion == 2) { 337 337 mr_asprintf(tmp1, "tail -n5 %s | grep Insufficient | tail -n1", MONDO_LOGFILE); 338 tmp = call_program_and_get_last_line_of_output(tmp1 );338 tmp = call_program_and_get_last_line_of_output(tmp1,TRUE); 339 339 mr_free(tmp1); 340 340 } else { 341 341 mr_asprintf(tmp1, "tail -n5 %s | grep lvcreate | tail -n1", MONDO_LOGFILE); 342 tmp = call_program_and_get_last_line_of_output(tmp1 );342 tmp = call_program_and_get_last_line_of_output(tmp1,TRUE); 343 343 mr_free(tmp1); 344 344 } … … 1579 1579 if (pout_to_fdisk) { 1580 1580 // mark relevant partition as bootable 1581 tmp1 = call_program_and_get_last_line_of_output ("make-me-bootable "MINDI_CACHE"/mountlist.txt dummy" );1581 tmp1 = call_program_and_get_last_line_of_output ("make-me-bootable "MINDI_CACHE"/mountlist.txt dummy",TRUE); 1582 1582 mr_asprintf(tmp, "a\n%s\n", tmp1); 1583 1583 mr_free(tmp1); -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-compare.c
r2623 r2704 631 631 /** needs malloc **/ 632 632 char *dir; 633 char *command = NULL;634 633 635 634 assert(bkpinfo != NULL); … … 683 682 int res; 684 683 char *dir; 685 char *command = NULL;686 684 687 685 assert(bkpinfo != NULL); -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c
r2696 r2704 719 719 mr_free(value); 720 720 721 tmp = call_program_and_get_last_line_of_output("cat " CMDLINE );721 tmp = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE); 722 722 if (strstr(tmp, "pxe")) { 723 723 /* We need to override prefix value in PXE mode as it's … … 904 904 905 905 tmp = read_cfg_var(MINDI_CACHE"/mondorestore.cfg", "please-dont-eject"); 906 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE );906 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE); 907 907 if (tmp || strstr(tmp1, "donteject")) { 908 908 bkpinfo->please_dont_eject = TRUE; … … 938 938 } 939 939 } 940 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE );940 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE); 941 941 if (strstr(tmp1, "pxe")) { 942 942 mr_free(tmp1); … … 997 997 mr_asprintf(command, "mount | grep -E '^%s' | tail -n1 | cut -d' ' -f3", g_isodir_device); 998 998 log_it("command = %s", command); 999 iso_mnt = call_program_and_get_last_line_of_output(command );999 iso_mnt = call_program_and_get_last_line_of_output(command,TRUE); 1000 1000 log_it("res of it = %s", iso_mnt); 1001 1001 mr_free(command); -
branches/2.2.10/mondo/src/mondorestore/mondorestore.c
r2696 r2704 448 448 log_it("Done loading config file; resizing ML"); 449 449 450 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE );450 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE); 451 451 if (strstr(tmp1, "noresize")) { 452 452 log_msg(1, "Not resizing mountlist."); … … 742 742 load_mountlist(mountlist, MINDI_CACHE"/mountlist.txt"); // in case read_cfg_file_into_bkpinfo updated the mountlist 743 743 744 tmp = call_program_and_get_last_line_of_output("cat " CMDLINE );744 tmp = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE); 745 745 if (strstr(tmp, "noresize")) { 746 746 log_msg(2, "Not resizing mountlist."); … … 777 777 twenty_seconds_til_yikes(); 778 778 g_fprep = fopen("/tmp/prep.sh", "w"); 779 tmp = call_program_and_get_last_line_of_output("cat " CMDLINE );779 tmp = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE); 780 780 if (strstr(tmp, "nopart")) { 781 781 log_msg(2, "Not partitioning drives due to 'nopart' option."); … … 850 850 851 851 after_the_nuke: 852 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE );852 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE); 853 853 if (retval) { 854 854 log_to_screen("Errors occurred during the nuke phase."); … … 2589 2589 /* Configure global variables */ 2590 2590 malloc_libmondo_global_strings(); 2591 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE );2591 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE); 2592 2592 if (strstr(tmp1, "textonly")) { 2593 2593 g_text_mode = TRUE; … … 2601 2601 setup_newt_stuff(); /* call newtInit and setup screen log */ 2602 2602 2603 tmp1 = call_program_and_get_last_line_of_output("which mondorestore" );2603 tmp1 = call_program_and_get_last_line_of_output("which mondorestore",TRUE); 2604 2604 strcpy(g_mondo_home, tmp1); 2605 2605 mr_free(tmp1); -
branches/2.2.10/mondo/src/mondorestore/mr-externs.h
r2623 r2704 18 18 extern int closein_tape(); 19 19 extern void close_evalcall_form(void); 20 extern char *call_program_and_get_last_line_of_output(char * );20 extern char *call_program_and_get_last_line_of_output(char *,bool); 21 21 extern void close_progress_form(void); 22 22 extern long count_lines_in_file(char *);
Note:
See TracChangeset
for help on using the changeset viewer.