#!/usr/bin/ksh

ORACLE_HOME=$1
FND_TOP=$2
APACHE_TOP=$3

# assumes ORACLE_HOME set
FORMS_VER=`$ORACLE_HOME/bin/f60run -? | grep Forms | grep Version | awk '{print $6}'`
FORMS_PORT=`grep serverPort $FND_TOP/resource/appsweb.cfg |awk -F= '{print $2}'`

REPORTS_VER=`$ORACLE_HOME/bin/rwrun60 -? | grep Release | awk '{print $4}'`
# not implemented for now
REPORTS_PORT=

JINIT_VER=`grep jinit_ver_name $FND_TOP/resource/appsweb.cfg |awk -F= '{print $3}'`

# assumes APACHE_TOP set
APACHE_VER=`grep "e SERVER_BASEVERSION" $APACHE_TOP/include/httpd.h |awk '{print $3}' | awk -F/ '{print $2}' | awk -F\" '{print $1}'`
APACHE_PORT=`grep "^Port" $APACHE_TOP/conf/httpd.conf | awk '{print $2}'`

echo em_result="$FORMS_VER|$FORMS_PORT|$REPORTS_VER|$REPORTS_PORT|$JINIT_VER|$APACHE_VER|$APACHE_PORT"

