#sccs	"@(#)fndetc/convert:instuaconvert	1.2"

#
#	FILE:  instuaconvert
#
#	This program copies the User-Agent file in /u/install to
#	a new name in /usr/lib/ua.  It then performs the uaconvert
#	on it and moves it back.
#

if [ $# -lt 2 ]
then
	echo "usage:  instuaconvert {oldfile} {newfile}"
	exit
fi

if [ $# -eq 3 ]
then	LISTING=$3
else	LISTING=""
fi

UA=/usr/lib/ua
OLDFILE=$1
NEWFILE=$2

#	The file resides in $CONVDIR somewhere.  It needs to be
#	copied to $UA for the uaconvert.  Then it must be movied
#	back to where it belongs.

cp $NEWFILE $UA/InstNew$$
uaconvert $OLDFILE $UA/InstNew$$ $LISTING
mv $UA/InstNew$$ $NEWFILE

#	Make sure files still have correct owner/group ids

chown install $NEWFILE
chgrp users $NEWFILE
