File:  [Research Unix] / researchv10no / cmd / uucp / unused / Cvt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

#!/bin/sh
#	execute this as root and in the /usr/spool/uucp directory.
#	execute
#	    Cvt C*
#	This will create required directories and move the
#	C. and D. files to the proper place.
#
#	use -n option to tell what will be done, but without doing it
#
# NOTE!!
#	It does not take care of X. files yet.

set +e
SPOOL=/usr/spool/uucp
TMP=/tmp/CVT

NC=`ls $SPOOL | grep -c "^C."`
if [ $NC -eq 0 ]
then
  echo "There are no old C. files in /usr/spool/uucp\nexiting"
  exit
fi

echo "
This shell (Cvt) will attempt to take the old C. and D. files
that are in $SPOOL and put them in the proper directories for
the new version of uucp.

If the files are not moved, they will never get executed after the
new uucp is installed.

There are $NC C. files in $SPOOL.

Do you wish to continue (Type y to continue)? \
\c"

read A
if [ x$A != "xy" ]; then exit; fi

while [ $# -gt 0 ]
do
	case $1 in
	-n)	ECHO=echo
		shift
		;;

	*)	break
		;;

	esac
done

cd $SPOOL
for i in C*
do 
# S is the 6 character system name
# E is the last 5 characters of C. name

  echo Processing: $i
  S=`echo $i | sed "s/..\(.*\)....../\1/"`
  E=`echo $i | sed "s/.*\(.....\)/\1/"`
  DIR=
  DIR=`uuname | grep "^$S"` 
  if [ -z "$DIR" ]
  then
	echo "*****Warning: There is no system=$S in the /usr/lib/uucp/Systems file. ******"
	DIR=$S
  fi
  DIR=`echo $DIR | sed "s/ .*//"`
  if [ ! -d $SPOOL/$DIR ]
	then
	    $ECHO  mkdir $SPOOL/$DIR
	    $ECHO  chmod 755 $SPOOL/$DIR
	    $ECHO  chown uucp $SPOOL/$DIR
  fi

    cat $i | while read AA ; do
	D=`echo $AA | cut -d" " -f6`
	if [ -n "$D" -a -f "$D" ]
	    then $ECHO mv $D $DIR/$D
	fi
    done
    S=`echo $DIR | sed "s/\(.......\).*/\1/"`
    $ECHO mv $i $DIR/C.$S$E

done

unix.superglobalmegacorp.com

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