Annotation of researchv10no/cmd/uucp/unused/Cvt, revision 1.1.1.1

1.1       root        1: #!/bin/sh
                      2: #      execute this as root and in the /usr/spool/uucp directory.
                      3: #      execute
                      4: #          Cvt C*
                      5: #      This will create required directories and move the
                      6: #      C. and D. files to the proper place.
                      7: #
                      8: #      use -n option to tell what will be done, but without doing it
                      9: #
                     10: # NOTE!!
                     11: #      It does not take care of X. files yet.
                     12: 
                     13: set +e
                     14: SPOOL=/usr/spool/uucp
                     15: TMP=/tmp/CVT
                     16: 
                     17: NC=`ls $SPOOL | grep -c "^C."`
                     18: if [ $NC -eq 0 ]
                     19: then
                     20:   echo "There are no old C. files in /usr/spool/uucp\nexiting"
                     21:   exit
                     22: fi
                     23: 
                     24: echo "
                     25: This shell (Cvt) will attempt to take the old C. and D. files
                     26: that are in $SPOOL and put them in the proper directories for
                     27: the new version of uucp.
                     28: 
                     29: If the files are not moved, they will never get executed after the
                     30: new uucp is installed.
                     31: 
                     32: There are $NC C. files in $SPOOL.
                     33: 
                     34: Do you wish to continue (Type y to continue)? \
                     35: \c"
                     36: 
                     37: read A
                     38: if [ x$A != "xy" ]; then exit; fi
                     39: 
                     40: while [ $# -gt 0 ]
                     41: do
                     42:        case $1 in
                     43:        -n)     ECHO=echo
                     44:                shift
                     45:                ;;
                     46: 
                     47:        *)      break
                     48:                ;;
                     49: 
                     50:        esac
                     51: done
                     52: 
                     53: cd $SPOOL
                     54: for i in C*
                     55: do 
                     56: # S is the 6 character system name
                     57: # E is the last 5 characters of C. name
                     58: 
                     59:   echo Processing: $i
                     60:   S=`echo $i | sed "s/..\(.*\)....../\1/"`
                     61:   E=`echo $i | sed "s/.*\(.....\)/\1/"`
                     62:   DIR=
                     63:   DIR=`uuname | grep "^$S"` 
                     64:   if [ -z "$DIR" ]
                     65:   then
                     66:        echo "*****Warning: There is no system=$S in the /usr/lib/uucp/Systems file. ******"
                     67:        DIR=$S
                     68:   fi
                     69:   DIR=`echo $DIR | sed "s/ .*//"`
                     70:   if [ ! -d $SPOOL/$DIR ]
                     71:        then
                     72:            $ECHO  mkdir $SPOOL/$DIR
                     73:            $ECHO  chmod 755 $SPOOL/$DIR
                     74:            $ECHO  chown uucp $SPOOL/$DIR
                     75:   fi
                     76: 
                     77:     cat $i | while read AA ; do
                     78:        D=`echo $AA | cut -d" " -f6`
                     79:        if [ -n "$D" -a -f "$D" ]
                     80:            then $ECHO mv $D $DIR/$D
                     81:        fi
                     82:     done
                     83:     S=`echo $DIR | sed "s/\(.......\).*/\1/"`
                     84:     $ECHO mv $i $DIR/C.$S$E
                     85: 
                     86: done

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.