# DIPTESTER Create diptester.properties Script
#  written by J.D. Smith, Principal Support Engineer, Oracle Support-Orlando
#
clear
# 
# Check if environment is set properly
#

if [ -z "$ORACLE_HOME" ] ; then
  echo 
  echo "ORACLE_HOME is not set in the environment. Please set this appropriately and retry."
  echo
  exit;
fi


########################################
## Accept Input Variables From the User 
########################################
echo " "
echo "PLEASE PROVIDE THE FOLLOWING VALUES NEEDED FOR INSTALLATION.  "
echo "(to override the default values in brackets just type in a new value.)"
echo "  "
echo "OID Information"
echo "=================================="
echo "  "
OIDHOST=`hostname`
printf "Enter Your Hostname [$OIDHOST]: "
  read NEW_OIDHOST
if [ $NEW_OIDHOST ] ; then 
   OIDHOST=$NEW_OIDHOST
fi
echo "  "
  printf "Enter the Oracle Home [$ORACLE_HOME]:  "
  read NEW_ORACLE_HOME
if [ $NEW_ORACLE_HOME ] ; then 
   ORACLE_HOME=$NEW_ORACLE_HOME
fi
echo "  "
printf "Enter the SID NAME of OID [$ORACLE_SID]: "
  read NEW_ORACLE_SID
if [ $NEW_ORACLE_SID ] ; then 
   ORACLE_SID=$NEW_ORACLE_SID
fi

echo " "
printf "Enter the LDAP Port# of OID LDAP Server: "
  read OIDPORT
echo " "
printf "Enter the SSL LDAP Port# of OID LDAP Server: "
  read OIDSSLPORT
echo " "

printf "Is this OID / ODISRV Deployed in a RAC? [YES or NO]:  "
read ANS
  if [ "y" = $ANS  -o "Y" = $ANS -o "yes" = $ANS -o "YES" = $ANS -o "Yes" = $ANS ] ; then
    RAC=YES
  else
    RAC=NO
  fi
echo " "

printf "Enter the orcladmin Password: "
  stty -echo; read OIDPWD ; stty echo ; echo
echo " "

echo "Obtaining the OID Realm For Synchronization....."
echo "  "

ldapsearch -h $OIDHOST -p $OIDPORT -L -D cn=orcladmin -w $OIDPWD -b "cn=Common,cn=Products,cn=OracleContext" -s base "objectclass=*" orcldefaultsubscriber>/tmp/defsub

  DEFSUB=`cat /tmp/defsub | grep orcldefaultsubscriber | cut -f 2 -d " "`

  REALM=cn=users,$DEFSUB

echo "  "
echo "  "
echo "OID Realm is usually the users container under the Defaut Subscriber Context."
echo "  "
printf "Synchronized Users will be added to ["$REALM"]:  "
  read NEW_REALM
if [ "$NEW_REALM" ] ; then
   REALM=$NEW_REALM
fi

echo " "
  echo "Available DIP Connectors"
  echo "========================"
  echo "0) Database Connector"
  echo "1) Iplanet/SunOne"
  echo "2) Microsoft Active Directory"
  echo "3) Novell eDirectory"
  echo "4) Open LDAP Directory"
  echo "5) Portal Provisioning"
  echo "6) Collab Suite Provisioning"
  echo "7) eBusiness Applications Provisioning"
  echo "8) Oracle HR Agent Connector"
  echo " "
  printf "Enter DIP Connector to Configure/Test:  "
  read DIPCONN

  case "$DIPCONN" in


0) echo "Configuring Oracle Database Connector"
  echo "======================================"
  echo " "

  CONN=dbconnector
  CONNID='Oracle Database Connector'
  CONFIGSET=1
  IPROFILE=DBImport
  EPROFILE=DBExport
  LOC=`pwd`
  IMPFILE=${ORACLE_HOME}/ldap/odi/diptester/dbsync/DBImport.map
  EXPFILE=${ORACLE_HOME}/ldap/odi/diptester/dbsync/DBExport.map
echo "  "
printf "Enter Name of Import Profile[$IPROFILE]: "
  read NEW_IPROFILE
  if [ $NEW_IPROFILE ] ; then 
   IPROFILE=$NEW_IPROFILE
  fi

echo "  "
printf "Enter Name of Import map file [$IMPFILE]: "
  read NEW_IMP
  if [ $NEW_IMP ] ; then 
   IMPFILE=$NEW_IMP
  fi

echo "  "
printf "Enter Name of Export Profile[$EPROFILE]: "
  read NEW_EPROFILE
  if [ $NEW_EPROFILE ] ; then 
   IPROFILE=$NEW_EPROFILE
  fi

echo "  "
printf "Enter Name of Export map file [$EXPFILE]: "
  read NEW_EXP
  if [ $NEW_EXP ] ; then 
   EXPFILE=$NEW_EXP
  fi

echo "  "
printf "Enter Database SID [$DBSID]: "
  read NEW_DBSID
  if [ $NEW_DBSID ] ; then 
   DBSID=$NEW_DBSID
  fi

echo "  "
printf "Enter Database User Name [$DBUSER]: "
  read NEW_DBUSER
  if [ $NEW_DBUSER ] ; then 
   DBUSER=$NEW_DBUSER
  fi
echo "  "
printf "Enter Database User Password [$DBPASS]: "
  read NEW_DBPASS
  if [ $NEW_DBPASS ] ; then 
   DBPASS=$NEW_DBPASS
  fi
;;

1) echo "Configuring SunOne/iPlanet Directory Server"
  echo "============================================"
  CONNID='SunOne/iPlanet Directory Server'
  CONFIGSET=1
  IPROFILE=IplanetImport
  EPROFILE=IplanetExport
  IMPFILE=${ORACLE_HOME}/ldap/odi/diptester/iplsync/iplanetimp.map
  EXPFILE=${ORACLE_HOME}/ldap/odi/diptester/iplsync/iplanetexp.map


echo "  "
echo "$CONNID Directory Information"
echo "========================================================="
printf "Enter the Hostname of the $CONNID LDAP Server[$LDAPHOST]: "
  read NEW_LDAPHOST
  if [ $NEW_LDAPHOST ] ; then 
   LDAPHOST=$NEW_LDAPHOST
  fi
echo "  "
LDAPPORT=389
printf "Enter the LDAP Port# of $CONNID LDAP Server[$LDAPPORT]: "
  read NEW_LDAPPORT
  if [ $NEW_LDAPPORT ] ; then 
   LDAPPORT=$NEW_LDAPPORT
  fi
echo "  "
LDAPSSLPORT=636
printf "Enter the LDAP SSL Port# of $CONNID LDAP Server[$LDAPSSLPORT]: "
  read NEW_LDAPSSLPORT
  if [ $NEW_LDAPSSLPORT ] ; then 
   LDAPSSLPORT=$NEW_LDAPSSLPORT
  fi
echo "  "
  printf "Enter root container of entries to be synchronized [$LDAPCTX]:  "
  read NEW_LDAPCTX
  if [ "$NEW_LDAPCTX" ] ; then 
   LDAPCTX=$NEW_LDAPCTX
  fi

echo "  "
printf "Enter the Account used to connect to the $CONNID LDAP Server[$LDAPADMIN]: "
  read NEW_LDAPADMIN
  if [ "$NEW_LDAPADMIN" ] ; then 
   LDAPADMIN=$NEW_LDAPADMIN
  fi

  printf "Enter the $CONNID LDAP Password: "
  stty -echo; read LDAPPWD ; stty echo ; echo
  echo "  "
dipassistant mp -host $OIDHOST -port $OIDPORT -dn cn=orcladmin -passwd $OIDPWD -profile $IPROFILE odip.profile.condirpassword=$LDAPPWD

echo "  "
echo "ONLY OVERRIDE THE DEFAULTS IF YOU ARE NOT USING STANDARD PROFILE. "
printf "Enter Name of Import Profile[$IPROFILE]: "
  read NEW_IPROFILE
  if [ $NEW_IPROFILE ] ; then 
   IPROFILE=$NEW_IPROFILE
  fi

echo "  "
printf "Enter Name of Import map file [$IMPFILE]: "
  read NEW_IMP
  if [ $NEW_IMP ] ; then 
   IMPFILE=$NEW_IMP
  fi

echo "  "
printf "Enter Name of Export Profile[$EPROFILE]: "
  read NEW_EPROFILE
  if [ $NEW_EPROFILE ] ; then 
   IPROFILE=$NEW_EPROFILE
  fi

echo "  "
printf "Enter Name of Export map file [$EXPFILE]: "
  read NEW_EXP
  if [ $NEW_EXP ] ; then 
   EXPFILE=$NEW_EXP
  fi
echo "  "
BSCFILE=${ORACLE_HOME}/ldap/odi/diptester/iplsync/ipl2oid.properties
printf "Enter Name of Bootstrap Configuration File [$BSCFILE]: "
  read NEW_BSCFILE
  if [ $NEW_BSCFILE ] ; then
   BSCFILE=$NEW_BSCFILE
  fi
;;

2) echo "Configuring Microsoft Active Directory Connector"
  echo "================================================="
  echo "  "
  CONNID='Microsoft Active Directory'
  CONFIGSET=1
  IPROFILE=ActiveChgImp
  EPROFILE=ActiveExport
  IMPFILE=${ORACLE_HOME}/ldap/odi/diptester/adsync/activechg.map
  EXPFILE=${ORACLE_HOME}/ldap/odi/diptester/adsync/activeexp.map


echo "  "
echo "$CONNID Directory Information"
echo "========================================================="
printf "Enter the Hostname of the $CONNID LDAP Server[$LDAPHOST]: "
  read NEW_LDAPHOST
  if [ $NEW_LDAPHOST ] ; then 
   LDAPHOST=$NEW_LDAPHOST
  fi
echo "  "
LDAPPORT=389
printf "Enter the LDAP Port# of $CONNID LDAP Server[$LDAPPORT]: "
  read NEW_LDAPPORT
  if [ $NEW_LDAPPORT ] ; then 
   LDAPPORT=$NEW_LDAPPORT
  fi
echo "  "
LDAPSSLPORT=636
printf "Enter the LDAP SSL Port# of $CONNID LDAP Server[$LDAPSSLPORT]: "
  read NEW_LDAPSSLPORT
  if [ $NEW_LDAPSSLPORT ] ; then 
   LDAPSSLPORT=$NEW_LDAPSSLPORT
  fi
echo "  "
  printf "Enter root container of entries to be synchronized [$LDAPCTX]:  "
  read NEW_LDAPCTX
  if [ "$NEW_LDAPCTX" ] ; then 
   LDAPCTX=$NEW_LDAPCTX
  fi

echo "  "
printf "Enter the Account used to connect to the $CONNID LDAP Server[$LDAPADMIN]: "
  read NEW_LDAPADMIN
  if [ "$NEW_LDAPADMIN" ] ; then 
   LDAPADMIN=$NEW_LDAPADMIN
  fi

  printf "Enter the $CONNID LDAP Password: "
  stty -echo; read LDAPPWD ; stty echo ; echo
  echo "  "
dipassistant mp -host $OIDHOST -port $OIDPORT -dn cn=orcladmin -passwd $OIDPWD -profile $IPROFILE odip.profile.condirpassword=$LDAPPWD

echo "  "
echo "ONLY OVERRIDE THE DEFAULTS IF YOU ARE NOT USING STANDARD PROFILE. "
printf "Enter Name of Import Profile[$IPROFILE]: "
  read NEW_IPROFILE
  if [ $NEW_IPROFILE ] ; then 
   IPROFILE=$NEW_IPROFILE
  fi

echo "  "
printf "Enter Name of Import map file [$IMPFILE]: "
  read NEW_IMP
  if [ $NEW_IMP ] ; then 
   IMPFILE=$NEW_IMP
  fi

echo "  "
printf "Enter Name of Export Profile [$EPROFILE]: "
  read NEW_EPROFILE
  if [ $NEW_EPROFILE ] ; then 
   EPROFILE=$NEW_EPROFILE
  fi

echo "  "
printf "Enter Name of Export map file [$EXPFILE]: "
  read NEW_EXP
  if [ $NEW_EXP ] ; then 
   EXPFILE=$NEW_EXP
  fi

echo "  "
BSCFILE=${ORACLE_HOME}/ldap/odi/diptester/adsync/ad2oid.properties
printf "Enter Name of Bootstrap Configuration File [$BSCFILE]: "
  read NEW_BSCFILE
  if [ $NEW_BSCFILE ] ; then
   BSCFILE=$NEW_BSCFILE
  fi
;;


3) echo "Configuring Novell eDirectory Directory Server"
  echo "==============================================="
  echo " "

  CONNID='Novell eDirectory LDAP Server'
  CONFIGSET=1
  IPROFILE=eDirectoryImp
  EPROFILE=eDirectoryExp
  LOC=`pwd`
  IMPFILE=${ORACLE_HOME}/ldap/odi/diptester/edirsync/edirectoryimp.map
  EXPFILE=${ORACLE_HOME}/ldap/odi/diptester/edirsync/edirectoryexp.map


echo "  "
echo "$CONNID Directory Information"
echo "========================================================="
printf "Enter the Hostname of the $CONNID LDAP Server[$LDAPHOST]: "
  read NEW_LDAPHOST
  if [ $NEW_LDAPHOST ] ; then 
   LDAPHOST=$NEW_LDAPHOST
  fi
echo "  "
LDAPPORT=389
printf "Enter the LDAP Port# of $CONNID LDAP Server[$LDAPPORT]: "
  read NEW_LDAPPORT
  if [ $NEW_LDAPPORT ] ; then 
   LDAPPORT=$NEW_LDAPPORT
  fi
echo "  "
LDAPSSLPORT=636
printf "Enter the LDAP SSL Port# of $CONNID LDAP Server[$LDAPSSLPORT]: "
  read NEW_LDAPSSLPORT
  if [ $NEW_LDAPSSLPORT ] ; then 
   LDAPSSLPORT=$NEW_LDAPSSLPORT
  fi
echo "  "
  printf "Enter root container of entries to be synchronized [$LDAPCTX]:  "
  read NEW_LDAPCTX
  if [ "$NEW_LDAPCTX" ] ; then 
   LDAPCTX=$NEW_LDAPCTX
  fi

echo "  "
printf "Enter the Account used to connect to the $CONNID LDAP Server[$LDAPADMIN]: "
  read NEW_LDAPADMIN
  if [ "$NEW_LDAPADMIN" ] ; then 
   LDAPADMIN=$NEW_LDAPADMIN
  fi

  printf "Enter the $CONNID LDAP Password: "
  stty -echo; read LDAPPWD ; stty echo ; echo
  echo "  "
dipassistant mp -host $OIDHOST -port $OIDPORT -dn cn=orcladmin -passwd $OIDPWD -profile $IPROFILE odip.profile.condirpassword=$LDAPPWD

echo "  "
echo "ONLY OVERRIDE THE DEFAULTS IF YOU ARE NOT USING STANDARD PROFILE. "
printf "Enter Name of Import Profile[$IPROFILE]: "
  read NEW_IPROFILE
  if [ $NEW_IPROFILE ] ; then 
   IPROFILE=$NEW_IPROFILE
  fi

echo "  "
printf "Enter Name of Import map file [$IMPFILE]: "
  read NEW_IMP
  if [ $NEW_IMP ] ; then 
   IMPFILE=$NEW_IMP
  fi

echo "  "
printf "Enter Name of Export Profile[$EPROFILE]: "
  read NEW_EPROFILE
  if [ $NEW_EPROFILE ] ; then 
   IPROFILE=$NEW_EPROFILE
  fi

echo "  "
printf "Enter Name of Export map file [$EXPFILE]: "
  read NEW_EXP
  if [ $NEW_EXP ] ; then 
   EXPFILE=$NEW_EXP
  fi
echo "  "
BSCFILE=${ORACLE_HOME}/ldap/odi/diptester/edirsync/edir2oid.properties
printf "Enter Name of Bootstrap Configuration File [$BSCFILE]: "
  read NEW_BSCFILE
  if [ $NEW_BSCFILE ] ; then
   BSCFILE=$NEW_BSCFILE
  fi
;;

4) echo "Configuring Open LDAP Directory Server"
  echo "======================================="
  echo " "

  CONNID='OpenLdap Directory Server'
  CONFIGSET=1
  IPROFILE=OpenLdapImport
  EPROFILE=OpenLdapExport
  LOC=`pwd`
  IMPFILE=${ORACLE_HOME}/ldap/odi/diptester/opldsync/openldapimp.map
  EXPFILE=${ORACLE_HOME}/ldap/odi/diptester/opldsync/openldapexp.map


echo "  "
echo "$CONNID Directory Information"
echo "========================================================="
printf "Enter the Hostname of the $CONNID LDAP Server[$LDAPHOST]: "
  read NEW_LDAPHOST
  if [ $NEW_LDAPHOST ] ; then 
   LDAPHOST=$NEW_LDAPHOST
  fi
echo "  "
LDAPPORT=389
printf "Enter the LDAP Port# of $CONNID LDAP Server[$LDAPPORT]: "
  read NEW_LDAPPORT
  if [ $NEW_LDAPPORT ] ; then 
   LDAPPORT=$NEW_LDAPPORT
  fi
echo "  "
LDAPSSLPORT=636
printf "Enter the LDAP SSL Port# of $CONNID LDAP Server[$LDAPSSLPORT]: "
  read NEW_LDAPSSLPORT
  if [ $NEW_LDAPSSLPORT ] ; then 
   LDAPSSLPORT=$NEW_LDAPSSLPORT
  fi
echo "  "
  printf "Enter root container of entries to be synchronized [$LDAPCTX]:  "
  read NEW_LDAPCTX
  if [ "$NEW_LDAPCTX" ] ; then 
   LDAPCTX=$NEW_LDAPCTX
  fi

echo "  "
printf "Enter the Account used to connect to the $CONNID LDAP Server[$LDAPADMIN]: "
  read NEW_LDAPADMIN
  if [ "$NEW_LDAPADMIN" ] ; then 
   LDAPADMIN=$NEW_LDAPADMIN
  fi

  printf "Enter the $CONNID LDAP Password: "
  stty -echo; read LDAPPWD ; stty echo ; echo
  echo "  "
dipassistant mp -host $OIDHOST -port $OIDPORT -dn cn=orcladmin -passwd $OIDPWD -profile $IPROFILE odip.profile.condirpassword=$LDAPPWD

echo "  "
echo "ONLY OVERRIDE THE DEFAULTS IF YOU ARE NOT USING STANDARD PROFILE. "
printf "Enter Name of Import Profile[$IPROFILE]: "
  read NEW_IPROFILE
  if [ $NEW_IPROFILE ] ; then 
   IPROFILE=$NEW_IPROFILE
  fi

echo "  "
printf "Enter Name of Import map file [$IMPFILE]: "
  read NEW_IMP
  if [ $NEW_IMP ] ; then 
   IMPFILE=$NEW_IMP
  fi

echo "  "
printf "Enter Name of Export Profile[$EPROFILE]: "
  read NEW_EPROFILE
  if [ $NEW_EPROFILE ] ; then 
   IPROFILE=$NEW_EPROFILE
  fi

echo "  "
printf "Enter Name of Export map file [$EXPFILE]: "
  read NEW_EXP
  if [ $NEW_EXP ] ; then 
   EXPFILE=$NEW_EXP
  fi
echo "  "
BSCFILE=${ORACLE_HOME}/ldap/odi/diptester/nsync/opld2oid.properties
printf "Enter Name of Bootstrap Configuration File [$BSCFILE]: "
  read NEW_BSCFILE
  if [ $NEW_BSCFILE ] ; then
   BSCFILE=$NEW_BSCFILE
  fi
;;

5) echo "Configuring Portal Provisioning"
  echo "================================"
  echo "  "
  CONFIGSET=0
  CONNID='Portal Provisioning Agent'
  PPROFILE=
  EPROFILE=
  IMPFILE=
  EXPFILE=

echo "  "
echo "Current Provisioning Profiles: "

ldapsearch -h $OIDHOST -p $OIDPORT -D cn=orcladmin -w $OIDPWD -b "cn=profiles,cn=provisioning,cn=Directory Integration Platform,cn=products,cn=OracleContext" -s sub "objectclass=*" orclodipprovisioningappname orclodipprovisioningorgname 
echo "-------------------------------------------------------------------------------------------- "
echo " "
echo " "
echo " Locate Name of Provisioning Profile from the above list..."
echo "  For Example:  orclODIPProfileName=xxxxxxxxxxxxxxxxxxxxxxxxxxxx_yyyyyyyyyyyyyyyyyyyyyyyy"
echo " "

printf "Enter the Value for orclODIPProfileName: "
  read NEW_PPROFILE
  if [ $NEW_PPROFILE ] ; then 
   PPROFILE=$NEW_PPROFILE
  fi

echo "  "
printf "Enter Portal Database SID [$DBSID]: "
  read NEW_DBSID
  if [ $NEW_DBSID ] ; then 
   DBSID=$NEW_DBSID
  fi

echo "  "
printf "Enter Database User Name [$DBUSER]: "
  read NEW_DBUSER
  if [ $NEW_DBUSER ] ; then 
   DBUSER=$NEW_DBUSER
  fi
echo "  "
printf "Enter Database User Password [$DBPASS]: "
  read NEW_DBPASS
  if [ $NEW_DBPASS ] ; then 
   DBPASS=$NEW_DBPASS
  fi
echo " "

;;


6) echo "Configuring Collabsuite Provisioning"
  echo "====================================="
  echo "  "
  CONFIGSET=0
  CONNID='Collabsuite Provisioning Agent'
  PPROFILE=
  EPROFILE=
  IMPFILE=
  EXPFILE=

echo "  "
echo "Current Provisioning Profiles: "

ldapsearch -h $OIDHOST -p $OIDPORT -D cn=orcladmin -w $OIDPWD -b "cn=profiles,cn=provisioning,cn=Directory Integration Platform,cn=Products,cn=OracleContext" -s sub "objectclass=*" orclodipprovisioningappname orclodipprovisioningorgname 
echo "-------------------------------------------------------------------------------------------- "
echo " "
echo " "
echo " Locate Name of Provisioning Profile from the above list..."
echo "  For Example:  orclODIPProfileName=xxxxxxxxxxxxxxxxxxxxxxxxxxxx_yyyyyyyyyyyyyyyyyyyyyyyy"
echo " "

printf "Enter the Value for orclODIPProfileName: "
  read NEW_PPROFILE
  if [ $NEW_PPROFILE ] ; then 
   PPROFILE=$NEW_PPROFILE
  fi

echo " "
echo "  "
printf "Enter Mail Store Database SID [$DBSID]: "
  read NEW_DBSID
  if [ $NEW_DBSID ] ; then 
   DBSID=$NEW_DBSID
  fi

echo "  "
printf "Enter Database User Name [$DBUSER]: "
  read NEW_DBUSER
  if [ $NEW_DBUSER ] ; then 
   DBUSER=$NEW_DBUSER
  fi
echo "  "
printf "Enter Database User Password [$DBPASS]: "
  read NEW_DBPASS
  if [ $NEW_DBPASS ] ; then 
   DBPASS=$NEW_DBPASS
  fi
echo " "
;;


7) echo "Configuring eBusiness Applications Provisioning"
  echo "================================================"
  echo "  "
  CONFIGSET=0
  CONNID='eBusiness Applications Provisioning Agent'
  PPROFILE=
  EPROFILE=
  IMPFILE=
  EXPFILE=

echo "  "
echo "Current Provisioning Profiles: "

ldapsearch -h $OIDHOST -p $OIDPORT -D cn=orcladmin -w $OIDPWD -b "cn=profiles,cn=provisioning,cn=Directory Integration Platform,cn=products,cn=OracleContext" -s sub "objectclass=*" orclodipprovisioningappname
echo "-------------------------------------------------------------------------------------------- "
echo " "
echo " "
echo " Locate Name of Provisioning Profile from the above list..."
echo "  Examples of a Valid Profile Name:"
echo "  orclODIPProfileName=xxxxxxxxxxxxxxxxxxxxxxxxxxxx_yyyyyyyyyyyyyyyyyyyyyyyy"
echo "                                  or"
echo "  cn=OIDToApplication,orclODIPProfileName=xxxxxxxxxxxxxxxxxxxxxxxxxxxx_yyyyyyyyyyyyyyyyyyyyyyyy"
echo " "

printf "Enter the Value for Provisioning Profile Name: "
  read NEW_PPROFILE
  if [ $NEW_PPROFILE ] ; then 
   PPROFILE=$NEW_PPROFILE
  fi
echo " "
echo " "
ldapsearch -h $OIDHOST -p $OIDPORT  -D cn=orcladmin -w $OIDPWD -b "cn=EBusiness,cn=Products,cn=oraclecontext,${DEFSUB}" -s one "objectclass=*" orclodipprovisioningappname
echo "-------------------------------------------------------------------------------------------- "
echo " "
echo " "
echo "Locate The Full DN of the Application from the above list.."
echo "  For Example:  orclApplicationCommonName=Prod1,cn=EBusiness,cn=Products,cn=OracleContext,dc=acme,dc=com"
printf "Enter The Full DN of the Application:  "
echo " "
  read NEW_PROVAPPDN
  if [ $NEW_PROVAPPDN ] ; then 
   PPROFILE=$NEW_PROVAPPDN
  fi
echo " "
printf "Enter Applications Database SID [$DBSID]: "
  read NEW_DBSID
  if [ $NEW_DBSID ] ; then 
   DBSID=$NEW_DBSID
  fi

echo "  "
printf "Enter Database User Name [$DBUSER]: "
  read NEW_DBUSER
  if [ $NEW_DBUSER ] ; then 
   DBUSER=$NEW_DBUSER
  fi
echo "  "
printf "Enter Database User Password [$DBPASS]: "
  read NEW_DBPASS
  if [ $NEW_DBPASS ] ; then 
   DBPASS=$NEW_DBPASS
  fi

;;

8) echo "Configuring OracleHRAgent Connector"
  echo "===================================="
  echo " "

  CONN=dbconnector
  CONNID='Oracle HRAgent Connector'
  CONFIGSET=1
  IPROFILE=OracleHRAgent
  LOC=`pwd`
  IMPFILE=${ORACLE_HOME}/ldap/odi/diptester/hrsync/oraclehragent.map
echo "  "
printf "Enter Name of Import Profile[$IPROFILE]: "
  read NEW_IPROFILE
  if [ $NEW_IPROFILE ] ; then 
   IPROFILE=$NEW_IPROFILE
  fi

echo "  "
printf "Enter Name of Import map file [$IMPFILE]: "
  read NEW_IMP
  if [ $NEW_IMP ] ; then 
   IMPFILE=$NEW_IMP
  fi

#echo "  "
#printf "Enter Name of Export Profile[$EPROFILE]: "
#  read NEW_EPROFILE
#  if [ $NEW_EPROFILE ] ; then 
#   IPROFILE=$NEW_EPROFILE
#  fi
#
#echo "  "
#printf "Enter Name of Export map file [$EXPFILE]: "
#  read NEW_EXP
#  if [ $NEW_EXP ] ; then 
#   EXPFILE=$NEW_EXP
#  fi

echo "  "
printf "Enter Database SID [$DBSID]: "
  read NEW_DBSID
  if [ $NEW_DBSID ] ; then 
   DBSID=$NEW_DBSID
  fi

echo "  "
printf "Enter Database User Name [$DBUSER]: "
  read NEW_DBUSER
  if [ $NEW_DBUSER ] ; then 
   DBUSER=$NEW_DBUSER
  fi
echo "  "
printf "Enter Database User Password [$DBPASS]: "
  read NEW_DBPASS
  if [ $NEW_DBPASS ] ; then 
   DBPASS=$NEW_DBPASS
  fi
;;

esac


echo "  "
echo "The Provisioning DIP server Must use configset 0."
echo "The Synchronization DIP server, by default, uses config set 1."
echo "  "
  printf "Configset # you are loading/starting [$CONFIGSET]:  "
  read NEW_CS
  if [ $NEW_CS ] ; then 
   CONFIGSET=$NEW_CS
  fi

  INSTANCE=2
echo "  "
echo "The Provisioning DIP server is usually run as instance 1."
echo "The Synchronization DIP server is usually run as instance 2."
echo "  "
  printf "The ODISRV will run as instance#[2]:  "
  read NEW_INSTANCE
  if [ $NEW_INSTANCE ] ; then 
   INSTANCE=$NEW_INSTANCE
  fi

echo " "

  GRPID=defaultgroup
echo "  "
echo "Enter the profile group name that this profile is to be associated with[$GRPID]:  "
echo "(This value is for OID Release 10.4.2 only, leave default for other versions)"
echo "  "
  read NEW_GRPID
  if [ $NEW_GRPID ] ; then 
   GRPID=$NEW_GRPID
  fi


# ================================================================================

printf "Do you wish to run this connector in SSL MODE [ Y or N ]:  "
read ANS
  if [ "y" = $ANS  -o "Y" = $ANS -o "yes" = $ANS -o "YES" = $ANS -o "Yes" = $ANS ] ; then
    SSLAUTH=2
  else
    SSLAUTH=0
  fi

# Connector ID value held in $DIPCONN
#
#  echo "0) Database Connector"
#  echo "1) Iplanet/SunOne"
#  echo "2) Microsoft Active Directory"
#  echo "3) Novell eDirectory"
#  echo "4) Open LDAP Directory"
#  echo "5) Portal Provisioning"
#  echo "6) Collab Suite Provisioning"
#  echo "7) eBusiness Applications Provisioning"
#  echo "8) OracleHRAgent Synchronization"
#  echo " "

clear
echo "========================================== "
echo "      CONFIGURATION SETTINGS SUMMARY"
echo "                  for"
echo " $CONNID"
echo "========================================== "
echo "OID CONNECTION INFO"
echo "------------------- "
echo "ORACLE HOME:  $ORACLE_HOME"
echo "ORACLE SID:  $ORACLE_SID"
echo "OID/LDAP SERVER HOST:  $OIDHOST"
echo "OID PORT NUMBER:  $OIDPORT"
echo "OID SSL PORT NUMBER:  $OIDSSLPORT"
echo "OID DEPLOYED IN RAC:  $RAC"
echo "OID ADMIN PASSWORD:  $OIDPWD"
echo "OID Identity Management Realm: $REALM"
echo " "

export REALM
export LDAPCTX

if [ $DIPCONN = "1" -o $DIPCONN = "2" -o $DIPCONN = "3" -o $DIPCONN = "4" ] ; then
echo "CONNECTOR INFO FOR 3RD PARTY LDAP SERVER"
echo "----------------------------------------"
echo "HOSTNAME:  $LDAPHOST"
echo "LDAP PORT:  $LDAPPORT"
echo "LDAP SSL PORT:  $LDAPSSLPORT"
echo "ADMIN USER:  $LDAPADMIN"
echo "ADMIN USER PASSWORD:  $LDAPPWD"
echo "Root container of entries to be synchronized:  $LDAPCTX"
echo " "
echo "DN of Import Profile:  orclODIPAgentName=${IPROFILE},cn=subscriber profile,cn=changelog Subscriber,cn=oracle internet directory"
echo "DN of Export Profile:  orclODIPAgentName=${EPROFILE},cn=subscriber profile,cn=changelog Subscriber,cn=oracle internet directory"
echo "Import Profile Map:  $IMPFILE"
echo "Export Profile Map:  $EXPFILE"
fi

if [ $DIPCONN = "0" -o $DIPCONN = "8" ] ; then
echo "Profile Loads to Configset:  $CONFIGSET"
echo " "
echo "DATABASE CONNECTION INFO: "
echo "________________________________"
echo "Database SID: $DBSID"
echo "Database User Name: $DBUSER"
echo "Database User Password: $DBPASS"
echo " "
echo "DN of Synchronization Profile:  orclODIPProfileName=${PPROFILE},cn=provisioning profiles,cn=changelog Subscriber,cn=oracle internet directory"
echo " "
fi

if [ $DIPCONN = "5" -o $DIPCONN = "6" -o $DIPCONN = "7" ] ; then
echo "PROVISIONING PROFILE CONNECTION INFO: "
echo "__________________________________________"
echo "Database SID: $DBSID"
echo "Database User Name: $DBUSER"
echo "Database User Password: $DBPASS"
echo "DN of Provisioning Profile:  orclODIPProfileName=${PPROFILE},cn=provisioning profiles,cn=changelog Subscriber,cn=oracle internet directory"
echo "Application DN: $PROVAPPDN "
echo " "
echo "========================================== "
fi

echo " "
printf "Are these values correct [y or n]? "
read CORRECT

if [ "n" = $CORRECT  -o "N" = $CORRECT -o "NO" = $CORRECT -o "no" = $CORRECT ] ; then
 exit -1
fi

echo "  "

propfile=diptester.properties

echo "####################################################################"
echo "                  I M P O R T A N T"
echo "The default properties file 'diptester.properties' MUST EXIST!"
echo "However, if you are configuring for a second DIP connector choose a name for this"
echo "new properties file.. the name of the property file MUST begin with \"diptester\""
echo " and end with \"properties\"."
echo "  "
echo "####################################################################"
echo "  "
printf "Hit Enter Key for default name or Enter New diptester-xxx.properties file ["$propfile"]:  "
  read NEW_propfile
if [ $NEW_propfile ] ; then 
   propfile=$NEW_propfile
fi


echo "####################################################################">${propfile}
echo "## This file contains information required for diptester to be    ##">>${propfile}
echo "## able to configure and test a DIP synch or provisioning profile.##">>${propfile}
echo "##                                                                ##">>${propfile}
echo "## The filename MUST begin with diptester and end with .properties##">>${propfile}
echo "## For example:  ${propfile}, diptester-myAD.ini,        ##">>${propfile}
echo "##                                                                ##">>${propfile}
echo "## DO NOT CONFUSE THIS PROFFILE WITH A DIP CONNECTOR PROFILE, this ##">>${propfile}
echo "## profile is used to control the behavior of DIPTESTER only it   ##">>${propfile}
echo "## does nothing to a DIP synch connector's profile.               ##">>${propfile}
echo "##                                                                ##">>${propfile}
echo "#################################################################### ">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# CONNID must contain the name of the Connector">>${propfile}
echo "#">>${propfile}
echo "# valid values are:">>${propfile}
echo "#">>${propfile}
echo "# CONNID = Microsoft Active Directory">>${propfile}
echo "# CONNID = SunOne Directory Server">>${propfile}
echo "# CONNID = Novell eDirectory Server">>${propfile}
echo "# CONNID = Open Ldap Directory Server">>${propfile}
echo "# CONNID = Oracle Database Connector">>${propfile}
echo "# CONNID = Oracle Collabsuite Provisioning">>${propfile}
echo "# CONNID = Oracle Provisioning Agent">>${propfile}
echo "# CONNID = Oracle HRAgent Connector">>${propfile}
echo "">>${propfile}
echo "CONNID = $CONNID">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# ORACLE_HOME and ORACLE SID: The absolute path of your ORACLE containing ">>${propfile}
echo "# a DIP synch profile and the ORACLE_SID used to connect">>${propfile}
echo "#">>${propfile}
echo "# NOTE - on windows you must escape the \ slashes.. for example:">>${propfile}
echo "#     ">>${propfile}
echo "#ORACLE_HOME = D:\\oracle\\asdb">>${propfile}
echo "ORACLE_HOME = $ORACLE_HOME">>${propfile}
echo " ">>${propfile}
echo "ORACLE_SID = $ORACLE_SID">>${propfile}
echo "">>${propfile}
echo "#">>${propfile}
echo "# OIDHOST that is running the odisrv process used for DIP synch">>${propfile}
echo "# can be simple hostname if your DNS can resolve it this way">>${propfile}
echo "# otherwise add domain name">>${propfile}
echo "">>${propfile}
echo "#OIDHOST = myhost.mydomain.com">>${propfile}
echo "">>${propfile}
echo "OIDHOST = $OIDHOST">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# OIDPORT for the odisrv non SSL communication to the oidldapd process">>${propfile}
echo "# This is usually the port listed in the default configset of the directory ">>${propfile}
echo "# server, but can be any user defined configset ldap port.">>${propfile}
echo "">>${propfile}
echo "OIDPORT = $OIDPORT">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# OIDSSLPORT for the odisrv SSL communication to the oidldapd process">>${propfile}
echo "# This must be an LDAP port that has been configured for SSL with a WALLET if">>${propfile}
echo "# you are planning on running the odisrv in authmode 2.  Otherwise use the">>${propfile}
echo "# ssl port of the default configset of the directory server">>${propfile}
echo "">>${propfile}
echo "OIDSSLPORT = $OIDSSLPORT">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# SSLAUTH is used to define whether the odiserv is to use SSL when communicating">>${propfile}
echo "# with the oidldapd server">>${propfile}
echo "# valid values are 0 (no auth) 1 (ssl auth-encryption), or 2 (ssl auth-using wallet">>${propfile} file
echo "# SSLAUTH mode 2 requires configuration of $OH/ldap/odi/conf/odi.properties file">>${propfile}
echo "">>${propfile}
echo "SSLAUTH = $SSLAUTH">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# RAC = YES denotes OID/ODISRV is running in a RAC environment.">>${propfile}
echo "# If this value is set to YES, then the oidctl command will include the host=<virtual host> when">>${propfile}
echo "# starting and stopping the odisrv process.  The OIDHOST above MUST be set to the virtual hostname.">>${propfile}
echo "">>${propfile}
echo "RAC = NO">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# REALM is the OID container where you are syncing TO in an Import profile or ">>${propfile}
echo "# synching FROM in an Export profile.">>${propfile}
echo "#">>${propfile}
echo "">>${propfile}
echo "REALM = $REALM">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# LDAPHOST is the host that you are synching from / to.  You must ensure that you">>${propfile}
echo "# have connectivity to this host for LDAP operations.  It can be simple hostname if ">>${propfile}
echo "# your DNS can resolve it this way otherwise add domain name">>${propfile}
echo "# Note: this value is not used for the Oracle Database connector or the Provisioining Profiles">>${propfile}
echo "">>${propfile}
echo "LDAPHOST = $LDAPHOST">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# LDAPPORT is the LDAP port that the DIP connector will use to communicate with ">>${propfile}
echo "# the 3rd party directory server for non SSL communication.">>${propfile}
echo "# Note: this value is not used for the Oracle Database connector or the Provisioining Profiles">>${propfile}
echo "">>${propfile}
echo "LDAPPORT = $LDAPPORT">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# LDAPSSLPORT is the LDAP port that the DIP connector will use to communicate with ">>${propfile}
echo "# the 3rd party directory server for SSL communication.  If you need to run the ">>${propfile}
echo "# odisrv authmode 2 you MUST set up your local wallet to contain the certificate of">>${propfile}
echo "# the remote root certificate authority and you must configure your odi.properties">>${propfile}
echo "# file in the $ORACLE_HOME/ldap/odi/conf directory.">>${propfile}
echo "# Note: this value is not used for the Oracle Database connector or the Provisioining Profiles">>${propfile}
echo "#">>${propfile}
echo "# Even though you may not be running the odisrv in SSL mode this value must still">>${propfile}
echo "# contain the ssl port of the remote LDAP server.">>${propfile}
echo "">>${propfile}
echo "LDAPSSLPORT = $LDAPSSLPORT">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# LDAPDMIN is the account name the DIP connector will use to connect to the remote">>${propfile}
echo "# LDAP server, for example:">>${propfile}
echo "# Note: this value is not used for the Oracle Database connector or the Provisioining Profiles">>${propfile}
echo "#">>${propfile}
echo "# on an Active Directory Server: LDAPADMIN = administrator@acme.com">>${propfile}
echo "#">>${propfile}
echo "# on a SunOne Directory Server: LDAPDMIN = cn=Directory Manager">>${propfile}
echo "# Note: this value is not used for the Oracle Database connector or the Provisioining Profiles">>${propfile}
echo "#">>${propfile}
echo "">>${propfile}
echo "LDAPADMIN = $LDAPADMIN">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# LDAPCTX is the the container on the 3rd party directory where you are synching FROM">>${propfile}
echo "# in an Import profile or synching TO in an Export profile.">>${propfile}
echo "# Note: this value is not used for the Oracle Database connector or the Provisioining Profiles">>${propfile}
echo "#">>${propfile}
echo "">>${propfile}
echo "LDAPCTX = $LDAPCTX">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# PPROFILE is the name of the PROVISIONING profile you are configuring and/or testing">>${propfile}
echo "#">>${propfile}
echo "PPROFILE = $PPROFILE">>${propfile}
echo "# PROVAPPDN is the full DN of the entry for the application as shown in the application under cn=(app),cn=products,cn=oraclecontext">>${propfile}
echo "PROVAPPDN = $PROVAPPDN">>${propfile}
echo "#">>${propfile}
echo "#">>${propfile}
echo "# IPROFILE is the name of the IMPORT profile you are configuring and/or testing">>${propfile}
echo "#">>${propfile}
echo "# Note: this value is not used for the Collabsuite or EBiz or the Provisioining Profiles">>${propfile}
echo "#">>${propfile}
echo "# standard profiles shipped with OID are:">>${propfile}
echo "#">>${propfile}
echo "# ActiveImport">>${propfile}
echo "# ActiveChgImp">>${propfile}
echo "# IplanetImport">>${propfile}
echo "# LdifImport">>${propfile}
echo "# TaggedImport">>${propfile}
echo "# OracleHRAgent">>${propfile}
echo "# eDirectoryImp">>${propfile}
echo "# OpenLdapImport">>${propfile}
echo "">>${propfile}
echo "IPROFILE = $IPROFILE">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# EPROFILE is the name of the EXPORT profile you are configuring and/or testing">>${propfile}
echo "# Note:  THERE IS NO EXPORT PROFILE for the Oracle Database Connector">>${propfile}
echo "# Note: this value is not used for the Oracle Database connector or the Provisioining Profiles">>${propfile}
echo "#">>${propfile}
echo "#">>${propfile}
echo "# ActiveExport">>${propfile}
echo "# IplanetExport">>${propfile}
echo "# LdifExport">>${propfile}
echo "# TaggedExport">>${propfile}
echo "# eDirectoryExp">>${propfile}
echo "# OpenLdapExport">>${propfile}
echo "">>${propfile}
echo "EPROFILE = $EPROFILE">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# IMPFILE defines the location of the IMPORT profile mapping file for this connector">>${propfile}
echo "# Note: this value is NOTE used for the Provisioining Profiles">>${propfile}
echo "#">>${propfile}
echo "# a sample working activechg.map mapping file is located in the ">>${propfile}
echo "#">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/adsync directory">>${propfile}
echo "#">>${propfile}
echo "# a sample working iplanetimp.map mapping file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/iplsync directory">>${propfile}
echo "# ">>${propfile}
echo "# a sample working oraclehragent.map mapping file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/hrsync directory">>${propfile}
echo "# ">>${propfile}
echo "# a sample working edirectoryimp.map mapping file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/edirsync directory">>${propfile}
echo "# ">>${propfile}
echo "# a sample working openldapimp.map mapping file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/opldsync directory">>${propfile}
echo "#">>${propfile}
echo "# Windows Users edit and uncomment the following line with your ORACLE_HOME home to use the default">>${propfile}
echo "">>${propfile}
echo "#IMPFILE = D:\\oracle\\asdb\\ldap\\diptester\\adsync\\activechg.map">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "#">>${propfile}
echo "# Unix Users edit and uncomment the following line with your ORACLE_HOME to use the default">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "#IMPFILE = /u01/app/oracle/product/asdb/ldap/odi/diptester/adsync/activechg.map">>${propfile}
echo "">>${propfile}
echo "IMPFILE = $IMPFILE">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# EXPFILE defines the location of the EXPORT profile mapping file for this connector">>${propfile}
echo "#">>${propfile}
echo "# a sample working activeexp.map mapping file is located in the ">>${propfile}
echo "#">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/adsync directory">>${propfile}
echo "#">>${propfile}
echo "# a sample working iplanetexp.map mapping file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/iplsync directory">>${propfile}
echo "#">>${propfile}
echo "# a sample working edirectoryexp.map mapping file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/edirsync directory">>${propfile}
echo "#">>${propfile}
echo "# a sample working openldapexp.map mapping file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/opldsync directory">>${propfile}
echo "#">>${propfile}
echo "# a sample working oraclehragent.map mapping file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/hrsync directory">>${propfile}
echo "#">>${propfile}
echo "# Windows Users edit and uncomment the following line with your ORACLE_HOME to use the default">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "#EXPFILE = D:\\oracle\\asdb\\ldap\\odi\\dipteter\\adsync\\activeexp.map">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "#">>${propfile}
echo "# Unix Users edit and uncomment the following line with your ORACLE_HOME to use the default">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "#EXPFILE = /u01/app/oracle/product/asdb/ldap/odi/diptester/adsync/activeexp.map">>${propfile}
echo "">>${propfile}
echo "EXPFILE = $EXPFILE">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# ">>${propfile}
echo "# BSCFILE defines the location of the file containing a bootstrap configuration profile.">>${propfile}
echo "#">>${propfile}
echo "# a sample working ad2oid.properties bootstrap configuration file is located in the ">>${propfile}
echo "#">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/adsync directory">>${propfile}
echo "#">>${propfile}
echo "# a sample working ipl2oid.properties bootstrap configuration file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/iplsync directory">>${propfile}
echo "">>${propfile}
echo "# a sample working edir2oid.properties bootstrap configuration file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/edirsync directory">>${propfile}
echo "# a sample working opld2oid.properties bootstrap configuration file is located in the ">>${propfile}
echo "# ">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/opldsync directory">>${propfile}
echo "# ">>${propfile}
echo "# Windows Users edit and uncomment the following line with your ORACLE_HOME to use the default">>${propfile}
echo "#     $ORACLE_HOME/ldap/odi/diptester/iplsync directory">>${propfile}
echo "">>${propfile}
echo "# Windows Users edit and uncomment the following line with your ORACLE_HOME to use the default">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "#BSCFILE = D:\\oracle\\asdb\\ldap\\odi\\diptester\\iplsync\\ipl2oid.properties">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "#">>${propfile}
echo "# Unix Users edit and uncomment the following line with your oracle home to use the default">>${propfile}
echo "#">>${propfile}
echo "">>${propfile}
echo "#BSCFILE = /u01/app/oracle/product/asdb/ldap/odi/diptester/iplsync/ipl2oid2.properties">>${propfile}
echo "">>${propfile}
echo "BSCFILE = $BSCFILE">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# CONFIGSET and INSTANCE define the odisrv instance and configset being used for DIP">>${propfile}
echo "# synchronization operations.  ">>${propfile}
echo "#">>${propfile}
echo "# Note:  If you have installed either Portal or Collabsuite it is very likely that an ">>${propfile}
echo "# odisrv PROVISIONING server is being used.  DIP provisioning ALWAYS uses CONFIGSET 0,">>${propfile}
echo "# and are usually started prior to a synchronization server and run as INSTANCE 1.">>${propfile}
echo "#">>${propfile}
echo "#">>${propfile}
echo "# DIP synchronization uses CONFIGSET 1.">>${propfile}
echo "#">>${propfile}
echo "">>${propfile}
echo "CONFIGSET = $CONFIGSET">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# INSTANCE defines the odisrv instance that will run this connector.  ">>${propfile}
echo "">>${propfile}
echo "INSTANCE = $INSTANCE">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# GRPID defines the profile group name that this profile is to be associated with.  ">>${propfile}
echo "# (This is only used by release 10.4.2 and may be left with defautlgroup for previous releases)  ">>${propfile}
echo "">>${propfile}
echo "GRPID = $GRPID">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# DBSID and DBUSER and DBPASS are used for the Oracle Database Connector or eBiz Apps and can be left blank.">>${propfile}
echo "# If configuring for the Oracle Database Connector or eBiz Apps, you MUST edit your TNSNAMES.ORA to allow a">>.${propfile}
echo "# SQLPLUS Connection from this host to the host where the database is running.">>${propfile}
echo "">>${propfile}
echo "#DBSID = mydb">>${propfile}
echo "DBSID = $DBSID">>${propfile}
echo "">>${propfile}
echo "#DBUSER = scott">>${propfile}
echo "DBUSER = $DBUSER">>${propfile}
echo "">>${propfile}
echo "#DBPASS = tiger">>${propfile}
echo "DBPASS = $DBPASS">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# EDITOR defines what editor you wish to use for diptester to edit mapping and config files">>${propfile}
echo "#">>${propfile}
echo "# For example:">>${propfile}
echo "#">>${propfile}
echo "# WINDOWS Users">>${propfile}
echo "#">>${propfile}
echo "#EDITOR = notepad.exe">>${propfile}
echo "#EDITOR = write.exe">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "#">>${propfile}
echo "# UNIX users">>${propfile}
echo "#">>${propfile}
echo "# Solaris Editors">>${propfile}
echo "#">>${propfile}
echo "#EDITOR = /usr/openwin/bin/xedit">>${propfile}
echo "#EDITOR = /usr/openwin/bin/xterm -bg white -fg black -exec /usr/bin/vi">>${propfile}
echo "">>${propfile}
echo "# HPUX Editors">>${propfile}
echo "#EDITOR = /usr/dt/bin/dtpad">>${propfile}
echo "#EDITOR = /usr/bin/X11/xterm -bg white -fg black -exec /usr/bin/vi">>${propfile}
echo "">>${propfile}
echo "# Linux Editors">>${propfile}
echo "#EDITOR = /usr/bin/xedit">>${propfile}
echo "#EDITOR = /usr/local/bin/vim">>${propfile}
echo "#EDITOR = /usr/X11R6/bin/xterm -bg white -fg black -exec /usr/bin/vi">>${propfile}
echo "">>${propfile}
OS=`uname`
 if [ "SunOS" = $OS ] ; then
   echo "EDITOR = /usr/openwin/bin/xterm -bg white -fg black -exec /usr/bin/vi">>${propfile}
 elif [ "Linux" = $OS ] ; then
   echo "EDITOR = /usr/X11R6/bin/xterm -bg white -fg black -exec /bin/vi">>${propfile}
 elif [ "HPUX" = $OS ] ; then
   echo "EDITOR = /usr/bin/X11/xterm -bg white -fg black -exec /usr/bin/vi">>${propfile}
 else
   echo "EDITOR = /usr/bin/X11/xterm -bg white -fg black -exec /usr/bin/vi">>${propfile}
 fi
echo "">>${propfile}
echo "">>${propfile}
echo "# LOGVIEWER = type">>${propfile}
echo "# LOGVIEWER = cat">>${propfile}
echo "# LOGVIEWER = tail -500">>${propfile}
echo "">>${propfile}
echo "LOGVIEWER = tail -500">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "TEMPDIR = /tmp">>${propfile}
echo "">>${propfile}
echo "">>${propfile}
echo "# Setting the DEBUG value to either 0 or 1 will controll logging of  all diptester commands to the">>${propfile}
echo "#$ORACLE_HOME/ldap/odi/log/diptester.log">>${propfile}
echo "">>${propfile}
echo "DEBUG = 1">>${propfile}

# copy to $OH in case this is being run after an install to create an additional properties file
cp ./${propfile} $ORACLE_HOME/ldap/odi/diptester/${propfile} >>/dev/null


cat ${propfile} | grep -v ^CONN | sed "s/ = /=/" > diptester.ini
echo " ">>diptester.ini
echo CONNID="'$CONNID'">>diptester.ini
echo " ">>diptester.ini
echo " ">>diptester.ini
echo "export CONNID">>diptester.ini
echo "export ORACLE_HOME">>diptester.ini
echo "export ORACLE_SID">>diptester.ini
echo "export OIDHOST">>diptester.ini
echo "export OIDPORT">>diptester.ini
echo "export OIDSSLPORT">>diptester.ini
echo "export SSLAUTH">>diptester.ini
echo "export REALM">>diptester.ini
echo "export LDAPHOST">>diptester.ini
echo "export LDAPPORT">>diptester.ini
echo "export LDAPSSLPORT">>diptester.ini
echo "export LDAPADMIN">>diptester.ini
echo "export IMPFILE">>diptester.ini
echo "export EXPFILE">>diptester.ini
echo "export CONFIGSET">>diptester.ini
echo "export INSTANCE">>diptester.ini
echo "export BSCFILE">>diptester.ini
echo "export DBSID">>diptester.ini
echo "export DBUSER">>diptester.ini
echo "export DBPASS">>diptester.ini


if [[ -d $ORACLE_HOME/ldap/odi/diptester ]] ; then

echo " "
echo "A New File ($propfile) Has Been Successfully Created."
echo " "
echo "This script (build_properties.sh) was run manually therefore you"
echo " will need to copy mapping files to appropriate directory."


else

echo " "
echo "A New File ($propfile) Has Been Successfully Created."
echo "Copying diptester files...."
echo ""
echo "Creating diptester directory in $ORACLE_HOME/ldap/odi..."
mkdir $ORACLE_HOME/ldap/odi/diptester
mkdir $ORACLE_HOME/ldap/odi/diptester/adsync
mkdir $ORACLE_HOME/ldap/odi/diptester/iplsync
mkdir $ORACLE_HOME/ldap/odi/diptester/dbsync
mkdir $ORACLE_HOME/ldap/odi/diptester/edirsync
mkdir $ORACLE_HOME/ldap/odi/diptester/hrsync
mkdir $ORACLE_HOME/ldap/odi/diptester/opldsync
mkdir $ORACLE_HOME/ldap/odi/diptester/oidsync

echo ""
echo "Copying default diptester.properties..."
cp diptester.properties $ORACLE_HOME/ldap/odi/diptester
cp diptester-prov.properties $ORACLE_HOME/ldap/odi/diptester
cp diptester.properties.master $ORACLE_HOME/ldap/odi/diptester/properties.master
cp prop2ini.sh $ORACLE_HOME/ldap/odi/diptester
cp build_properties.sh $ORACLE_HOME/ldap/odi/diptester

echo ""
echo "Copying diptester to $ORACLE_HOME/bin..."
cp diptester $ORACLE_HOME/bin


echo ""
echo "Copying diptester.jar to $ORACLE_HOME/ldap/odi/jlib..."
cp diptester.jar $ORACLE_HOME/ldap/odi/jlib

ACME="cn=users,dc=acme,dc=com"
DEFDN="${ACME}:${ACME}"
IMPORTDN="${LDAPCTX}:${REALM}"
EXPORTDN="${REALM}:${LDAPCTX}"

echo ""
echo "Copying Active Directory sample files..."

cat activechg.map | sed "s/${DEFDN}/${IMPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/adsync/activechg.map
cat activeexp.map | sed "s/${DEFDN}/${EXPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/adsync/activeexp.map
cp ad2oid.properties   $ORACLE_HOME/ldap/odi/diptester/adsync

echo ""
echo "Copying SunOne/Iplanet Directory sample files..."
cp iplanet*  $ORACLE_HOME/ldap/odi/diptester/iplsync
cat iplanetimp.map | sed "s/${DEFDN}/${IMPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/iplsync/iplanetimp.map
cat iplanetexp.map | sed "s/${DEFDN}/${EXPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/iplsync/iplanetexp.map
cp ipl2oid.properties   $ORACLE_HOME/ldap/odi/diptester/iplsync

echo ""
echo "Copying Novell eDirectory sample files..."
cp edirectory*  $ORACLE_HOME/ldap/odi/diptester/edirsync
cat edirectoryimp.map | sed "s/${DEFDN}/${IMPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/edirsync/edirectoryimp.map
cat edirectoryexp.map | sed "s/${DEFDN}/${EXPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/edirsync/edirectoryexp.map
cp edir2oid.properties   $ORACLE_HOME/ldap/odi/diptester/edirsync

echo ""
echo "Copying Open LDAP Directory sample files..."
cp openld*  $ORACLE_HOME/ldap/odi/diptester/opldsync
cat openldapimp.map | sed "s/${DEFDN}/${IMPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/opldsync/openldapimp.map
cat openldapexp.map | sed "s/${DEFDN}/${EXPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/opldsync/openldapexp.map
cp opld2oid.properties   $ORACLE_HOME/ldap/odi/diptester/edirsync

echo ""
echo "Copying OID to OID sample files..."
cp OIDImport.cfg $ORACLE_HOME/ldap/odi/conf
cat oidimport.map | sed "s/${DEFDN}/${IMPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/oidsync/oidimport.map
cp ipl2oid.properties   $ORACLE_HOME/ldap/odi/diptester/oidsync/oid2oid.properties

echo ""
echo "Copying Oracle Database Connector sample files..."
cp DB*  $ORACLE_HOME/ldap/odi/diptester/dbsync
cp *DB* $ORACLE_HOME/ldap/odi/diptester/dbsync
cp create_*_profile.sh $ORACLE_HOME/ldap/odi/diptester/dbsync
cp delete_trigger.sql $ORACLE_HOME/ldap/odi/diptester/dbsync
cat DBImport.map | sed "s/${DEFDN}/${IMPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/dbsync/DBImport.map
cp HREmpSync.*  $ORACLE_HOME/ldap/odi/diptester/dbsync

echo ""
echo ""
echo "Copying Oracle HRAgent Connector sample files..."
cp oraclehragent* $ORACLE_HOME/ldap/odi/diptester/hrsync
cp OracleHRAgent* $ORACLE_HOME/ldap/odi/diptester/hrsync > /dev/null
cat oraclehragent.map | sed "s/${DEFDN}/${IMPORTDN}/g"  > $ORACLE_HOME/ldap/odi/diptester/hrsync/oraclehragent.map

echo ""
echo "Copying the Character Based version of DIP Tester"
echo " "
cp cdiptester $ORACLE_HOME/bin >>/dev/null
cat diptester.properties | grep -v ^CONN | sed "s/ = /=/" > diptester.ini
echo " ">>diptester.ini
echo CONNID="'$CONNID'">>diptester.ini
echo " ">>diptester.ini
echo " ">>diptester.ini
echo "export CONNID">>diptester.ini
echo "export ORACLE_HOME">>diptester.ini
echo "export ORACLE_SID">>diptester.ini
echo "export OIDHOST">>diptester.ini
echo "export OIDPORT">>diptester.ini
echo "export OIDSSLPORT">>diptester.ini
echo "export SSLAUTH">>diptester.ini
echo "export REALM">>diptester.ini
echo "export LDAPHOST">>diptester.ini
echo "export LDAPPORT">>diptester.ini
echo "export LDAPSSLPORT">>diptester.ini
echo "export LDAPADMIN">>diptester.ini
echo "export IMPFILE">>diptester.ini
echo "export EXPFILE">>diptester.ini
echo "export CONFIGSET">>diptester.ini
echo "export INSTANCE">>diptester.ini
echo "export BSCFILE">>diptester.ini
echo "export DBSID">>diptester.ini
echo "export DBUSER">>diptester.ini
echo "export DBPASS">>diptester.ini

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

cp diptester.ini $ORACLE_HOME

echo " "
echo "Diptester Installation Complete"
echo " "
echo "To run DIP Tester enter the command: diptester"
echo " "
echo "With your Oracle environment properly set, it will run automatically since"
echo "the DIP Tester executable was copied to the '$ORACLE_HOME/bin' directory"
echo "by this install script."
echo " "
echo "If you are running remote over a slow connection you may wish to run the "
echo "character based version of diptester by including the flag " -char" on,"
echo "the command line,"
echo "for example:  diptester -char"
echo " "

echo "Please review the diptester_readme.html for additional information."
echo " "
echo " "
fi




