Changeset 276 for trunk


Ignore:
Timestamp:
Jan 3, 2006, 5:01:12 PM (13 years ago)
Author:
bcornec
Message:

merge -r274:275 $SVN_M/branches/2.06

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/analyze-my-lvm

    r98 r276  
    11#!/bin/sh
    2 
     2#
     3# $Id$
     4#
    35
    46#------------------------- ANALYZE-MY-LVM ----------------------- Hugo Rabson
     
    4244GetValueFromField() {
    4345    local res
    44     cat "$1" | sed s/'    '/~/ | tr -s ' ' ' ' | sed s/'~ '/'~'/ | grep -i "$2~" | cut -d'~' -f2,3,4,5 | tr '~' ' ' | gawk '{ if ($2=="MB") {printf "%sm",$1;} else if ($2=="KB") {printf "%sk",$1;} else if ($2=="GB") {printf "%sg",$1;} else {print $0;};}'
     46    sed s/'    '/~/ "$1" | tr -s ' ' ' ' | sed s/'~ '/'~'/ | grep -i "$2~" | cut -d'~' -f2,3,4,5 | tr '~' ' ' | gawk '{ if ($2=="MB") {printf "%sm",$1;} else if ($2=="KB") {printf "%sk",$1;} else if ($2=="GB") {printf "%sg",$1;} else {print $0;};}'
    4547}
    4648
     
    244246# -------------------------------- main -----------------------------------
    245247which lvmdiskscan 2>/dev/null 2>&1 || Die "Cannot find lvmdiskscan. Are you sure you're using LVM?"
    246 if [ -e "/proc/lvm/global" ] && [ "`cat /proc/lvm/global | tr -s '\t' ' ' | grep "0 VGs 0 PVs 0 LVs"`" != "" ] ; then
     248if [ -e "/proc/lvm/global" ] && [ "`tr -s '\t' ' ' < /proc/lvm/global | grep "0 VGs 0 PVs 0 LVs"`" != "" ] ; then
    247249    exit 0
    248250fi
  • trunk/mindi/mindi

    r274 r276  
    808808    echo -en "$DONE\nMaking complete dependency list"
    809809
    810     cat $tempfile | tr -s '/' '/' | sort | uniq > $tempfile.new
     810    tr -s '/' '/' < $tempfile | sort | uniq > $tempfile.new
    811811    mv -f $tempfile.new $tempfile
    812812    > $outfile.pre
     
    863863    fi
    864864    fi
    865      cat $outfile.pre | tr ' ' '\n' | tr -s '/' '/' | fgrep -vx "" | sort -u | egrep -v "/libX11|/libXext|/libXi|/libgtk|/libgdk" > $outfile
     865     tr ' ' '\n' < $outfile.pre | tr -s '/' '/' | fgrep -vx "" | sort -u | egrep -v "/libX11|/libXext|/libXi|/libgtk|/libgdk" > $outfile
    866866    rm -f $tempfile $outfile.pre
    867867    [ "$res" -eq "0" ] && echo -e "\r\t\t\t\t\t\t\t\t$DONE" || echo "\nFailed."
     
    12461246    if [ $tmpmodprobe_flag == "Y" ] ; then
    12471247    infile="/tmp/modprobe.conf.mindi.$$"
    1248     cat `find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f` > $infile
     1248    find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f > $infile
    12491249    else
    12501250    infile="/etc/modules.conf"
     
    13311331    [ "$c_p" = "none" ] && continue
    13321332        absolute_partition=`ResolveSoftlink $c_p`
    1333     partition_mountpt=`cat $MY_FSTAB | tr -s '\t' ' ' | grep -w "$current_partition" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
     1333    partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
    13341334    redhat_label=""
    13351335    if [ "`echo "$current_partition" | fgrep -i "LABEL="`" != "" ] ; then
     
    13581358            totalsize=0
    13591359            items=0
    1360             for i in `cat /proc/swaps | tr -s ' ' '\t' | fgrep -v "Filename" | cut -f3` ; do
     1360            for i in `tr -s ' ' '\t' < /proc/swaps | fgrep -v "Filename" | cut -f3` ; do
    13611361            totalsize=$(($totalsize+$i))
    13621362            items=$(($items+1))
     
    14721472    echo -en "  " > $1
    14731473    if [ "`fgrep -i "debian" /etc/issue.net 2> /dev/null`" ] ; then
    1474         cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ >> $1.tmp
    1475     else
    1476         cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' '\\r' 'on' 'an' '\/' '`uname -r`' 'on' 'an' '`uname -m`/ >> $1.tmp
    1477     fi
    1478     cat $1.tmp | sed s/%r/"`uname -r`"/ | sed s/%t/"`hostname`"/ > $1
     1474        sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ >> $1.tmp
     1475    else
     1476        sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' '\\r' 'on' 'an' '\/' '`uname -r`' 'on' 'an' '`uname -m`/ >> $1.tmp
     1477    fi
     1478    sed s/%r/"`uname -r`"/ $1.tmp | sed s/%t/"`hostname`"/ > $1
    14791479    rm -f $1.tmp
    14801480    if [ "$CDRECOVERY" != "yes" ] ; then
     
    15961596    if [ -e "$MONDO_TMP/start-nfs" ] ; then
    15971597    mv isolinux.cfg isolinux.cfg.old
    1598     cat isolinux.cfg.old | sed s/interactive/iso/ > isolinux.cfg
     1598    sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg
    15991599    fi
    16001600    if [ "$ARCH" != "ia64" ] ; then
     
    16411641    disksize=$1
    16421642    if [ "`fgrep -i "debian" /etc/issue.net 2> /dev/null`" ] ; then
    1643         cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/
    1644     else
    1645         cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' 'r' 'on' 'an' 'm/' '`uname -r`' 'on' 'an' '`uname -m`/
     1643        sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/
     1644    else
     1645        sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' 'r' 'on' 'an' 'm/' '`uname -r`' 'on' 'an' '`uname -m`/
    16461646    fi
    16471647    if [ "$disksize" -gt "2880" ] ; then
     
    20182018    if [ -e "$MONDO_TMP/start-nfs" ] ; then
    20192019    mv syslinux.cfg syslinux.cfg.orig
    2020     cat syslinux.cfg.orig | sed s/interactive/iso/ > syslinux.cfg
     2020    sed s/interactive/iso/ syslinux.cfg.orig > syslinux.cfg
    20212021    fi
    20222022    cd $old_pwd
     
    24472447    tempfile=$TMP_ROOT/$$.strip.txt
    24482448    cp -f $1 $tempfile
    2449     cat $tempfile | $AWK '{if (substr($0,0,1)!="#" || substr($0,0,3)=="#!/") {print $0;};}' > $1
     2449    $AWK '{if (substr($0,0,1)!="#" || substr($0,0,3)=="#!/") {print $0;};}' $tempfile > $1
    24502450    rm -f $tempfile
    24512451    echo "Stripped comments from $2" >> $LOGFILE
  • trunk/mindi/rootfs/sbin/hack-cfg-if-necessary

    r30 r276  
    11#!/bin/sh
     2#
     3# $Id$
     4#
    25
    36if ! mount | grep cdrom ; then
     
    2023LogIt "Re-jigging mondo-restore.cfg because you backed up to ISOs and then burned them to CDs" 1
    2124mv -f /tmp/mondo-restore.cfg /tmp/mrco
    22 cat /tmp/mrco | sed 's/backup-media-type iso/backup-media-type cdr/' > /tmp/mondo-restore.cfg
     25sed 's/backup-media-type iso/backup-media-type cdr/' /tmp/mrco > /tmp/mondo-restore.cfg
    2326LogIt "Done re-jigging. Yay."
    2427exit 0
  • trunk/mondo/mondo/common/libmondo-devices.c

    r274 r276  
    20182018    asprintf(&exclude_these_devices,
    20192019           call_program_and_get_last_line_of_output
    2020            ("cat /etc/fstab | tr -s '\t' ' ' | grep -E '( (coda|ncpfs|nfs|smbfs|cifs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
     2020           ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
    20212021    asprintf(&result_sz, "%s", exclude_these_directories);
    20222022    paranoid_free(exclude_these_devices);
  • trunk/mondo/mondo/common/libmondo-filelist.c

    r274 r276  
    490490//      sort_file(filelist); // FIXME - filelist chopper sorts, so this isn't necessary
    491491        asprintf(&command,
    492                  "cat %s | getfacl --all-effective -P - 2>> %s | gzip -c1 > %s 2>> %s",
     492                 "getfacl --all-effective -P %s 2>> %s | gzip -c1 > %s 2>> %s",
    493493                 filelist, MONDO_LOGFILE, facl_fname, MONDO_LOGFILE);
    494494        iamhere(command);
  • trunk/mondo/mondo/common/libmondo-tools.c

    r274 r276  
    173173file=$i/.directory; if [ -f \"$file\" ] ; then mv -f $file $file.old ; \
    174174awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \
    175 else { print $0;};}'$file.old  > $file ; fi ; done");
     175else { print $0;};}' $file.old  > $file ; fi ; done");
    176176    run_program_and_log_output(tmp, 5);
    177177    paranoid_free(tmp);
  • trunk/mondo/mondo/mondo-makefilelist

    r274 r276  
    11#!/bin/sh
     2#
     3# $Id$
     4
    25#
    36# mondo-makefilelist
     
    8285    res=`grep -v "Permission denied" $TMP/find.log`
    8386    if [ "$res" != "" ] ; then
    84     cat $TMP/find.log
    85     cat $TMP/find.log >> $LOGFILE
     87    cat $TMP/find.log | tee -a $LOGFILE
    8688    fi
    8789# include various directory _paths_ (not contents of dirs: that comes later)
     
    105107
    106108# Patch from Andy Glass - 03/03/2002
    107     for i in `cat /etc/fstab | tr -s '\t' ' ' | cut -d' ' -f2 | grep -v '-'` ; do
     109    for i in `tr -s '\t' ' ' < /etc/fstab | cut -d' ' -f2 | grep -v '-'` ; do
    108110# End patch
    109 #     for i in `cat /etc/fstab | tr -s '\t' ' ' | cut -d' ' -f2` ; do
    110111        grep -vx "$i/lost+found" $output | grep -vx $i"lost+found" > $output.MID
    111112        sync
     
    113114    done
    114115# exclude .journal files (ext3)
    115     for i in `cat /etc/fstab | tr -s '\t' ' ' | grep "ext3" | cut -d' ' -f2` ; do
     116    for i in `tr -s '\t' ' ' < /etc/fstab | grep "ext3" | cut -d' ' -f2` ; do
    116117    grep -vx "$i/\.journal" $output | grep -vx "$i\.journal" | grep -vx "$i\.autofsck" > $output.MID
    117118        sync
  • trunk/mondo/mondo/mondorestore/mondo-rstr-compare.c

    r171 r276  
    378378    if (length_of_file(logfile) > 5) {
    379379        sprintf(command,
    380                 "cat %s | sed s/': \\\"'/\\|/ | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort | uniq | grep -vx \"dev/.*\" >> /tmp/changed.txt",
     380                "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort | uniq | grep -vx \"dev/.*\" >> /tmp/changed.txt",
    381381                logfile);
    382382        system(command);
  • trunk/mondo/mondo/restore-scripts/mondo/hack-lilo

    r274 r276  
    1515GetOldFstabMountpoint() {
    1616    local res
    17     res=`cat $old_fstab | tr -s '\t' ' ' | grep "$1" | cut -d' ' -f2`
     17    res=`tr -s '\t' ' ' < $old_fstab | grep "$1" | cut -d' ' -f2`
    1818#    echo "old_fstab = $old_fstab" >> /dev/stderr
    1919    if [ "$res" = "" ] ; then
    2020#   echo "OK, resB" >> /dev/stderr
    21     res=`cat $old_mountlist | tr -s '\t' ' ' | grep " $1 " | cut -d' ' -f1`
     21    res=`tr -s '\t' ' ' < $old_mountlist | grep " $1 " | cut -d' ' -f1`
    2222    fi
    2323    echo "$res"
     
    3434    old_mountpoint=`GetOldFstabMountpoint $1`
    3535#    echo "old_mountpoint = $old_mountpoint" >> /dev/stderr
    36     new_mountpoint=`cat $new_mountlist | tr -s '\t' ' ' | grep " $old_mountpoint" | cut -d' ' -f1`
     36    new_mountpoint=`tr -s '\t' ' ' < $new_mountlist | grep " $old_mountpoint" | cut -d' ' -f1`
    3737    if [ "$new_mountpoint" = "" ] ; then
    38     mtpt=`cat $new_mountlist | tr -s '\t' ' ' | grep " $old_mountpoint " | cut -d' ' -f2`
    39     dev=`cat $new_mountlist | tr -s '\t' ' ' | grep " $mtpt " | cut -d' ' -f1`
     38    mtpt=`tr -s '\t' ' ' < $new_mountlist | grep " $old_mountpoint " | cut -d' ' -f2`
     39    dev=`tr -s '\t' ' ' < $new_mountlist | grep " $mtpt " | cut -d' ' -f1`
    4040#   echo "NEW_MP (A) = $dev" >> /dev/stderr
    4141#    else
  • trunk/mondo/mondo/restore-scripts/mondo/stabelilo-me

    r30 r276  
    8686
    8787WhatIsFirstDriveCalled() {
    88     cat /tmp/mountlist.txt | cut -d' ' -f1 \
     88    cut -d' ' -f1 /tmp/mountlist.txt \
    8989| sed s/[0-9]// | sed s/[0-9]// \
    90 | sort | uniq | head -n 1
     90| sort -u | head -n 1
    9191}
    9292
  • trunk/tools/rpm-env

    r262 r276  
    3535if [ -e /etc/mandriva-release ]; then
    3636    export ddir="mandriva"
    37     export dver=`cat /etc/mandriva-release | awk '{print $4}'`
     37    export dver=`awk '{print $4}' /etc/mandriva-release`
    3838    export suf="${dver}mdk"
    3939elif [ -e /etc/mandrake-release ]; then
    4040    export ddir="mandrake"
    41     export dver=`cat /etc/mandrake-release | awk '{print $3}'`
     41    export dver=`awk '{print $3}' /etc/mandrake-release`
    4242    export suf="${dver}mdk"
    4343elif [ -e /etc/redhat-release ]; then
     
    4545    if [ $? -eq 0 ]; then
    4646        export ddir="rhel"
    47         export dver=`cat /etc/redhat-release | awk '{print $7}'`
     47        export dver=`awk '{print $7}' /etc/redhat-release`
    4848    elif grep -q Fedora /etc/redhat-release ; then
    4949        export ddir="fedora"
    50         export dver=`cat /etc/redhat-release | awk '{print $4}'`
     50        export dver=`awk '{print $4}' /etc/redhat-release`
    5151        export suf="fc${dver}"
    5252    else
    5353        export ddir="redhat"
    54         export dver=`cat /etc/redhat-release | awk '{print $5}' | sed "s/\.//"`
     54        export dver=`awk '{print $5}' /etc/redhat-release | sed "s/\.//"`
    5555        export suf="rh${dver}"
    5656    fi
     
    5959    if [ $? -eq 0 ]; then
    6060        export ddir="sles"
    61         export dver=`cat /etc/SuSE-release | head -1 | awk '{print $5}'`
     61        export dver=`head -1 /etc/SuSE-release | awk '{print $5}'`
    6262    else
    6363        export ddir="suse"
    64         export dver=`cat /etc/SuSE-release | head -1 | awk '{print $3}'`
     64        export dver=`head -1 /etc/SuSE-release | awk '{print $3}'`
    6565    fi
    6666else
Note: See TracChangeset for help on using the changeset viewer.