
# UNISRC_ID: @(#)cppro.sh	27.1	85/03/10  
# Script to copy a file over a protected file (or a new file) and reprotect.


#       PATH=/bin:/usr/bin:/usr/contrib/bin

# Check arguments:

	if [ $# != 2 ]
	then
		echo "usage: $0 sourcefile destdir|file"
		exit 1
	fi

# Build destination file name:

	if [ -d "$2" ]
	then
		dest="$2"/`basename "$1"`
	else
		dest="$2"
	fi

# Unprotect, copy file, reprotect:

	set -x
	chmod +w "$dest"
	cp $1 "$dest"
	chmod -w "$dest"
