#!/bin/ksh
echo " "
ls *.properties
echo " "

echo "This utility will convert the specified properties file to an 'ini' file"
echo "for use with the character based DIP Tester"
echo " "
printf "Enter Your Source 'diptester.properties' file without the extension: "
read DTFILE
echo " "
echo Building $DTFILE.ini from $DTFILE.properties....

cat $DTFILE.properties | grep -v ^CONN | sed "s/ = /=/" > $DTFILE.ini
echo " ">>$DTFILE.ini
grep ^CONNID $DTFILE.properties | read CONNID

echo CONNID="'$CONNID'">>$DTFILE.ini
echo " ">>$DTFILE.ini
echo " ">>$DTFILE.ini
echo "export CONNID">>$DTFILE.ini
echo "export ORACLE_HOME">>$DTFILE.ini
echo "export ORACLE_SID">>$DTFILE.ini
echo "export OIDHOST">>$DTFILE.ini
echo "export OIDPORT">>$DTFILE.ini
echo "export OIDSSLPORT">>$DTFILE.ini
echo "export SSLAUTH">>$DTFILE.ini
echo "export REALM">>$DTFILE.ini
echo "export LDAPHOST">>$DTFILE.ini
echo "export LDAPPORT">>$DTFILE.ini
echo "export LDAPSSLPORT">>$DTFILE.ini
echo "export LDAPADMIN">>$DTFILE.ini
echo "export IMPFILE">>$DTFILE.ini
echo "export EXPFILE">>$DTFILE.ini
echo "export CONFIGSET">>$DTFILE.ini
echo "export INSTANCE">>$DTFILE.ini
echo "export BSCFILE">>$DTFILE.ini
echo "export DBSID">>$DTFILE.ini
echo "export DBUSER">>$DTFILE.ini
echo "export DBPASS">>$DTFILE.ini

mv $ORACLE_HOME/$DTFILE.ini $ORACLE_HOME/$DTFILE.ini.`date +%m%d$y%H%M%S` 2> /dev/null

mv $DTFILE.ini $ORACLE_HOME

echo $DTFILE.ini has been copied to $ORACLE_HOME

