#!/bin/bash
#
#########################################################################################
# Script: 		generate_properties.sh
# Description: 	Generate deployment properties based on config files
# Author: 		ABS Laundry Business Solutions
# Version: 		9.08.00
#### Changelog of script ################################################################
# Date        Author    Version 	Change    
# 29-Feb-2011 JMI		1.0			Initial version
# 31-May-2011 JMI		1.1			Extended with Oracle home for Application server
# 26-Sep-2011 ROP		1.4			Added generating of webconfiguration files
# 27-Nov-2014 JMI		1.5			Changed all Reportserver.properties to ReportServer.properties
# 08-Jun-2015 ROP		1.6			Added custom properties 
#									faces-config.xml/default-locale and sun-web.xml/extra-class-path
# 24-Mar-2017 MBU		2.5			Changes for uhfmonitor application
# 26-Mar-2019 MBU		3.3			Added support to deploy new webapplications: wua=webclient my uniform assistant wrd=webclient residential delivery wrr=webclient route returns
# 04-Apr-2019 MBU		4.0			Added generation of RMIDIAGNOSTICPORT in absserver.properties
#									Added property generation of rac connection
# 27-Jun-2019 MBU		4.3			Bugfix: Service retrieval on partial environment name hit
# 15-Jul-2019 MBU		4.4			Bugfix: Custom config settings not working
# 20-Mar-2024 RAY       6.0         Support for Glassfish4, Payara5, Tomee8, Tomee91 and Tomcat90
# 03-Apr-2024 RAY       9.08.00		Renamed version
# 25-Apr-2024 RAY       9.08.00     Added Support for Tomcat9 - ABS-164468
# 01-Jul-2024 RAY       9.08.01     Added Support for Tomcat9 and Tomcat10 - ABS-165658
# 21-Aug-2024 RAY       9.08.01     TI changes for replacing TomEE with Tomcat in 9.08.00 - ABS-167946
# 04-Nov-2024 RAY		9.09.00 	Absmenu update supporting Java21 for ABSSolute 9.09.00 - ABS-170835
# 04-Nov-2024 RAY		9.09.00 	Absmenu update supporting Plugins folder - INSTALLER-176
# 04-Nov-2024 RAY		9.09.00 	Absmenu update supporting Application Server new Classpath location - ABS-170842
# 16-Dec-2024 RAY		9.09.00 	Fix for ABSGENERICWEBSERVICE loj4j.properties file
# 01-Jun-2025 RAY       9.09.02     ABSSolute Server - Standardization & hot redeploy - TS-839
#########################################################################################

generate_log4j()
{
# $1 - Filename
# $2 - Servername
# $3 - Logdir
# $4 - Logfilename (Server / ReportServer / WebPortal / WebPortaln / GenericWebservice / WebService2 / MobileWebService)
    if [ "$ABS_ROOTSERVER" == "$2" ] 
    then
        echo "log4j.rootLogger=INFO,FILEAPPENDER,ROLLINGAPPENDER,CONSOLEAPPENDER" > $1
        echo "log4j.appender.FILEAPPENDER=org.apache.log4j.FileAppender" >> $1
        echo "log4j.appender.FILEAPPENDER.File=$3/ABS$4Log.log" >> $1
        echo "log4j.appender.FILEAPPENDER.Threshold=OFF" >> $1
        echo "log4j.appender.FILEAPPENDER.Append=FALSE" >> $1
        echo "log4j.appender.FILEAPPENDER.layout=org.apache.log4j.PatternLayout" >> $1
        echo "log4j.appender.FILEAPPENDER.layout.ConversionPattern=%d [%t] %-5p %c (%F:%L) :: %m%n" >> $1
        echo "log4j.appender.CONSOLEAPPENDER=org.apache.log4j.ConsoleAppender" >> $1
        echo "log4j.appender.CONSOLEAPPENDER.Target=System.out" >> $1
        echo "log4j.appender.CONSOLEAPPENDER.Threshold=OFF" >> $1
        echo "log4j.appender.CONSOLEAPPENDER.layout=org.apacheapache.log4j.PatternLayout" >> $1
        echo "log4j.appender.CONSOLEAPPENDER.layout.ConversionPattern=%20r %d %-5p multicart [%t] %c -%x %m%n" >> $1
        echo "log4j.appender.ROLLINGAPPENDER=org.apache.log4j.RollingFileAppender" >> $1
        echo "log4j.appender.ROLLINGAPPENDER.File=$3/ABS$4RollingLog.log" >> $1
        echo "log4j.appender.ROLLINGAPPENDER.MaxFileSize=10240KB" >> $1
        echo "log4j.appender.ROLLINGAPPENDER.Threshold=ERROR" >> $1
        echo "log4j.appender.ROLLINGAPPENDER.MaxBackupIndex=5" >> $1
        echo "log4j.appender.ROLLINGAPPENDER.layout=org.apache.log4j.PatternLayout" >> $1
        echo "log4j.appender.ROLLINGAPPENDER.layout.ConversionPattern=%p %t %c - %m%n" >> $1
        echo "log4j.category.org.apache=OFF" >> $1
        echo "log4j.category.org.hibernate=OFF" >> $1
        echo "log4j.category.absgroup.bl=OFF" >> $1
        echo "log4j.category.absgroup.dal=OFF" >> $1
        echo "log4j.category.org.snmp4j=ERROR" >> $1
        echo "log4j.category.absgroup.snmp=ERROR" >> $1
    else
        echo -n .
        ssh -n -q $2 "echo \"log4j.rootLogger=INFO,FILEAPPENDER,ROLLINGAPPENDER,CONSOLEAPPENDER\" > $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.FILEAPPENDER=org.apache.log4j.FileAppender\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.FILEAPPENDER.File=$3/ABS$4Log.log\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.FILEAPPENDER.Threshold=OFF\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.FILEAPPENDER.Append=FALSE\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.FILEAPPENDER.layout=org.apache.log4j.PatternLayout\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.FILEAPPENDER.layout.ConversionPattern=%d [%t] %-5p %c (%F:%L) :: %m%n\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.CONSOLEAPPENDER=org.apache.log4j.ConsoleAppender\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.CONSOLEAPPENDER.Target=System.out\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.CONSOLEAPPENDER.Threshold=OFF\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.CONSOLEAPPENDER.layout=org.apache.log4j.PatternLayout\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.CONSOLEAPPENDER.layout.ConversionPattern=%20r %d %-5p multicart [%t] %c -%x %m%n\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.ROLLINGAPPENDER=org.apache.log4j.RollingFileAppender\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.ROLLINGAPPENDER.File=$3/ABS$4RollingLog.log\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.ROLLINGAPPENDER.MaxFileSize=10240KB\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.ROLLINGAPPENDER.Threshold=ERROR\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.ROLLINGAPPENDER.MaxBackupIndex=5\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.ROLLINGAPPENDER.layout=org.apache.log4j.PatternLayout\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.appender.ROLLINGAPPENDER.layout.ConversionPattern=%p %t %c - %m%n\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.category.org.apache=OFF\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.category.org.hibernate=OFF\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.category.absgroup.bl=OFF\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.category.absgroup.dal=OFF\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.category.org.snmp4j=ERROR\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"log4j.category.absgroup.snmp=ERROR\" >> $1"
        echo ';'
    fi
}

generate_snmp()
{
# $1 - Filename
# $2 - Servername
# $3 - SNMP port
    if [ "$ABS_ROOTSERVER" == "$2" ] 
    then
        echo "SNMPVERSION=V1" > $1
        echo "NMSADDRESS=$2/$3" >> $1
        echo "SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE" >> $1
        echo "TRANSPORTPROTOCOL=UDP" >> $1
        echo "TARGETADDRESS=$SNMPTARGETADDRESS" >> $1
        echo "V1COMMUNITY=public" >> $1
        echo "TRAPV3NUMBEROFRETRIES=1" >> $1
        echo "TRAPV3TIMEOUTINMILLIS=1000" >> $1
    else
        echo -n .
        ssh -n -q $2 "echo \"SNMPVERSION=V1\" > $1"
        echo -n .
        ssh -n -q $2 "echo \"NMSADDRESS=$2/$3\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"TRANSPORTPROTOCOL=UDP\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"TARGETADDRESS=$SNMPTARGETADDRESS\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"V1COMMUNITY=public\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"TRAPV3NUMBEROFRETRIES=1\" >> $1"
        echo -n .
        ssh -n -q $2 "echo \"TRAPV3TIMEOUTINMILLIS=1000\" >> $1"
        echo ';'
    fi
}

HandleCustomProperties()
# $1 = environment
# $2 = server
# $3 = type (app, rep, gws, w4m, wp2, wsr, wum, wcl, wua, wrd, wrr, wsb, wmr, wfb, wcp)
#      mws=w4m wpon=wp2 rest=wsr uhfmon=wum webclienx=wcl webmyuniformassistant=wua webresidentialdelivery=wrd webclientroutereturns=wrr webclientreplacesmartbarcode=wsb mobilerest=wmr wfb=absmobilefirebaseservices wcp=webclientcleanroompackinginstructions
# $4 = absserver.properties file path 
# $5 = Reportserver.properties file path 
# $6 = crystalclear.properties file path
# $7 = absgenericwebservice.properties file path 
# $8 = SNMP file
# $9 = log4j file
# ${10} = web.xml file
# $(11) = faces-config.xml file
# $(12) = sun-web.xml file
{
    grep '^ *'$1"[[:blank:]]" $ABSMENUCUSTOMCONFIG | while read CUST_ENVIRONMENT CUST_TYPE CUST_FILE CUST_PROPERTY CUST_VALUE
    do
        if [ "$CUST_TYPE" == "$3" ]	# correct type read from file?
		then
			unset CUSTOMFILE
			case "$CUST_FILE" in
				absserver.properties)				CUSTOMFILE="$4";;
				application.properties)				CUSTOMFILE="$4";;
				Reportserver.properties)			CUSTOMFILE="$5";;
				crystalclear.properties)			CUSTOMFILE="$6";;
				absgenericwebservice.properties)	CUSTOMFILE="$7";;
				AbsSnmpAgentSettings.properties)	CUSTOMFILE="$8";;
				log4j.properties)					CUSTOMFILE="$9";;
				web.xml)							CUSTOMFILE="${10}";;
				faces-config.xml)					CUSTOMFILE="${11}";;
				sun-web.xml)                        CUSTOMFILE="${12}";;
			esac
			if [ "$CUSTOMFILE" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    EXISTSINFILE=$(grep -c -m1 -i $CUST_PROPERTY $CUSTOMFILE)
                else
                    EXISTSINFILE=$(ssh -n -q $2 "grep -c -m1 -i $CUST_PROPERTY $CUSTOMFILE")
                fi
				if [ "$EXISTSINFILE" != 0 ]
				then
                    # change / to \/
					CUST_VALUE=${CUST_VALUE//\//\\\/} 
                    
					if [ "$CUST_FILE" == web.xml ]
					then
                        if [ "$ABS_ROOTSERVER" == "$2" ] 
                        then
                            sed -i "/$CUST_PROPERTY/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$CUST_VALUE\3/;}" $CUSTOMFILE
                        else
                            ssh -n -q $2 "sed -i '/$CUST_PROPERTY/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$CUST_VALUE\3/;}' $CUSTOMFILE"
                        fi
					else
                        if [ "$CUST_FILE" == faces-config.xml ]
						then
							if [ "$CUST_PROPERTY" == default-locale ]
							then
                                SEARCHLOCALE='<supported-locale>'"$CUST_VALUE"
                                SCANFORTERM='<\/supported-locale>'
                                REPLACEWITHTERM='<supported-locale>'"$CUST_VALUE"'<\/supported-locale>'
                                if [ "$ABS_ROOTSERVER" == "$2" ] 
                                then
                                    sed -i "/\<$CUST_PROPERTY\>/ c\\\<$CUST_PROPERTY\>$CUST_VALUE\<\/$CUST_PROPERTY\>" $CUSTOMFILE
                                    # if the wanted locale is not found, insert a line to make it a supported locale
                                    SEARCHCOUNT=$(grep -c -m1 -i $SEARCHLOCALE $CUSTOMFILE)
                                    [ "$SEARCHCOUNT" == 0 ] && sed -i -e "/$SCANFORTERM/{i\ $REPLACEWITHTERM" -e ':a;\$q;n;ba;}' $CUSTOMFILE
                                else
                                    ssh -n -q $2 "sed -i '/\<$CUST_PROPERTY\>/ c\\\<$CUST_PROPERTY\>$CUST_VALUE\<\/$CUST_PROPERTY\>' $CUSTOMFILE"
                                    SEARCHCOUNT=`ssh -n -q $2 "grep -c -m1 -i '$SEARCHLOCALE' $CUSTOMFILE"`
                                    [ "$SEARCHCOUNT" == 0 ] && ssh -n -q $2 "sed -i -e '/$SCANFORTERM/{i\ $REPLACEWITHTERM' -e ':a;\$q;n;ba;}' $CUSTOMFILE"
                                fi
							else
                                if [ "$ABS_ROOTSERVER" == "$2" ] 
                                then
                                    sed -i "/$CUST_PROPERTY/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$CUST_VALUE\3/;}" $CUSTOMFILE
                                else
                                    ssh -n -q $2 "sed -i '/$CUST_PROPERTY/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$CUST_VALUE\3/;}' $CUSTOMFILE"
                                fi
							fi
						else
                            if [ "$CUST_FILE" == sun-web.xml ]
                            then
                                if [ "$CUST_PROPERTY" == extra-class-path ]
                                then
                                    if [ "$ABS_ROOTSERVER" == "$2" ] 
                                    then
                                        SEARCHCOUNT=$(grep -c -m1 -i $CUST_VALUE $CUSTOMFILE)
                                        [ $SEARCHCOUNT == 0 ] && sed -i "s/WEB-INF\/lib\/abs\/resources.jar/WEB-INF\/lib\/abs\/resources.jar\;$CUST_VALUE/" $CUSTOMFILE
                                    else
                                        SEARCHCOUNT=`ssh -n -q $2 "grep -c -m1 -i '$CUST_VALUE' $CUSTOMFILE"`
                                        [ "$SEARCHCOUNT" == 0 ] && ssh -n -q $2 "sed -i 's/WEB-INF\/lib\/abs\/resources.jar/WEB-INF\/lib\/abs\/resources.jar\;$CUST_VALUE/' $CUSTOMFILE"
                                    fi
                                fi
                            else
                                if [ "$ABS_ROOTSERVER" == "$2" ] 
                                then
                                    sed -i "/^$CUST_PROPERTY=/ c\\$CUST_PROPERTY=$CUST_VALUE" $CUSTOMFILE
                                else
                                    ssh -n -q $2 "sed -i '/^$CUST_PROPERTY=/ c\\$CUST_PROPERTY=$CUST_VALUE' $CUSTOMFILE"
                                fi
                            fi
						fi
                    fi
				else
                    if [ "$ABS_ROOTSERVER" == "$2" ] 
                    then
                        [ "$CUST_FILE" != web.xml ] && [ "$CUST_FILE" != faces-config.xml ] && [ "$CUST_FILE" != sun-web.xml ] && echo $CUST_PROPERTY=$CUST_VALUE >> $CUSTOMFILE
                    else
                        [ "$CUST_FILE" != web.xml ] && [ "$CUST_FILE" != faces-config.xml ] && [ "$CUST_FILE" != sun-web.xml ] && ssh -n -q $2 "echo $CUST_PROPERTY=$CUST_VALUE >> $CUSTOMFILE"
                    fi
				fi
			fi				
		fi
    done
}

do_web_config()
{
#  $1 - type (gws, w4m, wp2, wsr, wum, wcl, wua, wrd, wrr, wsb, wmr, wfb, wcp)
#      mws=w4m wpon=wp2 rest=wsr uhfmon=wum webclienx=wcl webmyuniformassistant=wua webresidentialdelivery=wrd webclientroutereturns=wrr webclientreplacesmartbarcode=wsb mobilerest=wmr wfb=absmobilefirebaseservices wcp=webclientcleanroompackinginstructions
#  $2 - servername
#  $3 - slot
#  $4 - local_home
#  $5 - user
#  $6 - pwd
#  $7 - stationnr
#  $8 - normal / deploy
#  $9 - webapp connects to this app-server machine
# $10 - webapp connects to this app-server slot
# $11 - webapp connects to this rep-server machine
# $12 - webapp connects to this rep-server slot
# $13 - webname
# $14 - environment
# $15 - domain
# $16 - user2 (mws, garment assistant)
# $17 - pwd2 (mws, garment assistant)
# $18 - stationnr2 (mws, garment assistant)
   
    V_APPSRV=$9
    SLOTNR=${10}; [ ${#SLOTNR} == "1" ] && SLOTNR="0"${10}
    V_NSPORT="5"$SLOTNR"11"
    V_REPSRV=${11}
    SLOTNR=${12}; [ ${#SLOTNR} == "1" ] && SLOTNR="0"${12}
    V_REPORTRMIPORT="5"$SLOTNR"21"
    V_REPORTHTTPPORT="5"$SLOTNR"22"
    ABSM_ENVIRONMENT="${14}"
    ABSM_GFDOMAIN="${15}"
    SLOTNR=$3; [ ${#SLOTNR} == "1" ] && SLOTNR="0"$3	

    case "$1" in
        gws)
            echo "Generating properties for generic webservice webcomponent on server $2, slot $3"
            export ABSMESSAGE="       Generating properties for generic webservice webcomponent on server $2, slot $3"
            absmenu_log

            if [ "$8" == "deploy" ]
            then        
                PROPERTIESFILEPATH="$4/deploy/gws/WEB-INF"
            else
                PROPERTIESFILEPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
			WEBXMLPATH="$PROPERTIESFILEPATH"
            PROPERTIESFILE="$PROPERTIESFILEPATH/classes/absgenericwebservice.properties"
            SNMPFILE="$PROPERTIESFILEPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"42"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
			if [ -e "$WEBXMLPATH/classes/log4j.properties" ]
			then 
				LOG4JFILE="$WEBXMLPATH/classes/log4j.properties"
			elif [ -e "$WEBXMLPATH/log4j2.xml" ]
			then
				LOG4JFILE="$WEBXMLPATH/log4j2.xml"
			else
				LOG4JFILE="$WEBXMLPATH/log4j.properties"
            fi
            export ABSMESSAGE="     Generating $PROPERTIESFILE"; absmenu_log

            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"

            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                [ -e $PROPERTIESFILEPATH/sample_absgenericwebservice.properties ] && cp -f $PROPERTIESFILEPATH/sample_absgenericwebservice.properties $PROPERTIESFILE
                [ -e $PROPERTIESFILEPATH/classes/sample_absgenericwebservice.properties ] && cp -f $PROPERTIESFILEPATH/classes/sample_absgenericwebservice.properties $PROPERTIESFILE
                sed -i "/^nsServer=/ c\nsServer=$V_APPSRV" $PROPERTIESFILE
                sed -i "/^nsPort=/ c\nsPort=$V_NSPORT" $PROPERTIESFILE
                sed -i "/^userName=/ c\userName=$5" $PROPERTIESFILE
                sed -i "/^password=/ c\password=$6" $PROPERTIESFILE
                sed -i "/^stationNumber=/ c\stationNumber=$7" $PROPERTIESFILE
                sed -i "/^logdir=/ c\logdir=$WEBLOGDIR\/" $PROPERTIESFILE
            else
                echo -n .
                ssh -n -q $2 "[ -e $PROPERTIESFILEPATH/sample_absgenericwebservice.properties ] && cp -f $PROPERTIESFILEPATH/sample_absgenericwebservice.properties $PROPERTIESFILE"
                echo -n .
                ssh -n -q $2 "[ -e $PROPERTIESFILEPATH/classes/sample_absgenericwebservice.properties ] && cp -f $PROPERTIESFILEPATH/classes/sample_absgenericwebservice.properties $PROPERTIESFILE"
                echo -n .
                ssh -n -q $2 "sed -i '/^nsServer=/ c\nsServer=$V_APPSRV' $PROPERTIESFILE"
                echo -n .
                ssh -n -q $2 "sed -i '/^nsPort=/ c\nsPort=$V_NSPORT' $PROPERTIESFILE"
                echo -n .
                ssh -n -q $2 "sed -i '/^userName=/ c\userName=$5' $PROPERTIESFILE"
                echo -n .
                ssh -n -q $2 "sed -i '/^password=/ c\password=$6' $PROPERTIESFILE"
                echo -n .
                ssh -n -q $2 "sed -i '/^stationNumber=/ c\stationNumber=$7' $PROPERTIESFILE"
                echo -n .
                ssh -n -q $2 "sed -i '/^logdir=/ c\logdir=$WEBLOGDIR\/' $PROPERTIESFILE"
                echo ';'
            fi            
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi          
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
			if [ -e "$WEBXMLPATH/log4j2.xml" ]
			then
				export ABSMESSAGE="     Skipped generating $LOG4JFILE (already exists)"; absmenu_log
			else
				if [ -e "$WEBXMLPATH/sample_log4j.properties" ] 
				then
					if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
					then
						cp $WEBXMLPATH/sample_log4j.properties $LOG4JFILE
						sed -i "/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$WEBLOGDIR/ABSGenericWebServiceLog.log" $LOG4JFILE
						sed -i "/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$WEBLOGDIR/ABSGenericWebServiceRollingLog.log" $LOG4JFILE
					else
						echo -n .
						ssh -n -q $ABSM_SERVERNAME "cp $WEBXMLPATH/sample_log4j.properties $LOG4JFILE"
						echo -n .
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$WEBLOGDIR/ABSGenericWebServiceLog.log' $LOG4JFILE"
						echo -n .
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$WEBLOGDIR/ABSGenericWebServiceRollingLog.log' $LOG4JFILE"
						echo ';'
					fi
				else
					generate_log4j $LOG4JFILE $ABSM_SERVERNAME $WEBLOGDIR GenericWebService
				fi
			fi
			HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" gws X X X "$PROPERTIESFILE" "$SNMPFILE" "$LOG4JFILE" X X X
			;;

        w4m)
            echo "Generating properties for mobilewebservice webcomponent on server $2, slot $3"
            export ABSMESSAGE="       Generating properties for mobilewebservice webcomponent on server $2, slot $3"
            absmenu_log

            if [ "$8" == "deploy" ]
            then        
                WEBXMLPATH="$4/deploy/w4m/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            FACESXML="$WEBXMLPATH/faces-config.xml"
            SUNWEBXML="$WEBXMLPATH/sun-web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"44"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            if [ -e "$WEBXMLPATH/log4j2.xml" ]
			then
				LOG4JFILE="$WEBXMLPATH/log4j2.xml"
			else
				LOG4JFILE="$WEBXMLPATH/log4j.properties"
            fi
			export ABSMESSAGE="       Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsHost/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
                sed -i "/defaultSystemUserLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$5\3/;}" $WEBXML
                sed -i "/defaultSystemPassLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$6\3/;}" $WEBXML
                sed -i "/defaultWorkstationLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
                sed -i "/defaultSystemUserGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${16}\3/;}" $WEBXML
                sed -i "/defaultSystemPassGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${17}\3/;}" $WEBXML
                sed -i "/defaultWorkstationGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${18}\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsHost/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/defaultSystemUserLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$5\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/defaultSystemPassLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$6\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/defaultWorkstationLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/defaultSystemUserGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${16}\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/defaultSystemPassGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${17}\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/defaultWorkstationGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${18}\3/;}' $WEBXML"
                echo ';'
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi           
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
            if [ -e "$WEBXMLPATH/log4j2.xml" ] 
			then
				export ABSMESSAGE="     Skipped generating $LOG4JFILE (already exists)"; absmenu_log
			else
				if [ -e "$WEBXMLPATH/sample_log4j.properties" ]
				then
					if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
					then
						cp $WEBXMLPATH/sample_log4j.properties $LOG4JFILE
						sed -i "/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$WEBLOGDIR/ABSMobileWebServiceLog.log" $LOG4JFILE
						sed -i "/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$WEBLOGDIR/ABSMobileWebServiceRollingLog.log" $LOG4JFILE
					else
						echo -n .
						ssh -n -q $ABSM_SERVERNAME "cp $WEBXMLPATH/sample_log4j.properties $LOG4JFILE"
						echo -n .
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$WEBLOGDIR/ABSMobileWebServiceLog.log' $LOG4JFILE"
						echo -n .
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$WEBLOGDIR/ABSMobileWebServiceRollingLog.log' $LOG4JFILE"
						echo ';'
					fi
				else
					generate_log4j $LOG4JFILE $ABSM_SERVERNAME $WEBLOGDIR MobileWebService
				fi
			fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" w4m X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" X X
			;;
			
        wp2)
            echo "Generating properties for new web portal webcomponent on server $2, slot $3"
            export ABSMESSAGE="       Generating properties for web portal webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then        
                WEBXMLPATH="$4/deploy/wp2/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
			FACESXML="$WEBXMLPATH/faces-config.xml"
			SUNWEBXML="$WEBXMLPATH/sun-web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"45"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
			if [ -e "$WEBXMLPATH/log4j2.xml" ]
			then
				LOG4JFILE="$WEBXMLPATH/log4j2.xml"
			else
				LOG4JFILE="$WEBXMLPATH/log4j.properties"
            fi
            export ABSMESSAGE="       Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
                sed -i "/userName/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$5\3/;}" $WEBXML
                sed -i "/password/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$6\3/;}" $WEBXML
                sed -i "/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
                sed -i "/NSReportServerHost/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPSRV\3/;}" $WEBXML
                sed -i "/NSReportServerHTTPPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPORTHTTPPORT\3/;}" $WEBXML
                sed -i "/NSReportServerRMIPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPORTRMIPORT\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/userName/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$5\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/password/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$6\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/NSReportServerHost/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/NSReportServerHTTPPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPORTHTTPPORT\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/NSReportServerRMIPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPORTRMIPORT\3/;}' $WEBXML"
                echo ';'
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi           
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
            if [ -e "$WEBXMLPATH/log4j2.xml" ]
			then
				export ABSMESSAGE="     Skipped generating $LOG4JFILE (already exists)"; absmenu_log
			else
				if [ -e "$WEBXMLPATH/sample_log4j.properties" ]
				then
					if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
					then
						cp $WEBXMLPATH/sample_log4j.properties $LOG4JFILE
						sed -i "/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$WEBLOGDIR/ABSWebPortalnLog.log" $LOG4JFILE
						sed -i "/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$WEBLOGDIR/ABSWebPortalnRollingLog.log" $LOG4JFILE
					else
						echo -n .
						ssh -n -q $ABSM_SERVERNAME "cp $WEBXMLPATH/sample_log4j.properties $LOG4JFILE"
						echo -n .
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$WEBLOGDIR/ABSWebPortalnLog.log' $LOG4JFILE"
						echo -n .
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$WEBLOGDIR/ABSWebPortalnRollingLog.log' $LOG4JFILE"
						echo ';'
					fi
				else
					generate_log4j $LOG4JFILE $ABSM_SERVERNAME $WEBLOGDIR WebPortaln
				fi
			fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wp2 X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
			;;
			
		wsr)
            echo "Generating properties for REST webcomponent on server $2, slot $3"
            export ABSMESSAGE="       Generating properties for REST webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then        
                WEBXMLPATH="$4/deploy/wsr/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"46"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            export ABSMESSAGE="       Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
				sed -i "/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
				ssh -n -q $2 "sed -i '/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi           
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wsr X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
			;;
			
		wum)
            echo "Generating properties for uhfmonitor webcomponent on server $2, slot $3"
            export ABSMESSAGE="       Generating properties for uhfmonitor webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then        
                WEBXMLPATH="$4/deploy/wum/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"47"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            export ABSMESSAGE="       Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
				sed -i "/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
				ssh -n -q $2 "sed -i '/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wum X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
			;;
			
        wcl)
            echo "Generating properties for WebClientX webcomponent on server $2, slot $3"
            export ABSMESSAGE="       Generating properties for WebClientX webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then        
                WEBXMLPATH="$4/deploy/wcl/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"48"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            export ABSMESSAGE="       Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
                sed -i "/NSReportServerHost/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPSRV\3/;}" $WEBXML
                sed -i "/NSReportServerHTTPPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPORTHTTPPORT\3/;}" $WEBXML
                sed -i "/NSReportServerRMIPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPORTRMIPORT\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/NSReportServerHost/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/NSReportServerHTTPPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPORTHTTPPORT\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/NSReportServerRMIPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_REPORTRMIPORT\3/;}' $WEBXML"
                echo ';'
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi           
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
            if [ -e "$WEBXMLPATH/sample_log4j.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    cp $WEBXMLPATH/sample_log4j.properties $LOG4JFILE
                    sed -i "/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$WEBLOGDIR/ABSWebPortalnLog.log" $LOG4JFILE
                    sed -i "/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$WEBLOGDIR/ABSWebPortalnRollingLog.log" $LOG4JFILE
                else
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "cp $WEBXMLPATH/sample_log4j.properties $LOG4JFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$WEBLOGDIR/ABSWebPortalnLog.log' $LOG4JFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$WEBLOGDIR/ABSWebPortalnRollingLog.log' $LOG4JFILE"
                    echo ';'
                fi
            else
                generate_log4j $LOG4JFILE $ABSM_SERVERNAME $WEBLOGDIR WebClientX
            fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wcl X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
			;;

		wua)
            echo "Generating properties for WebClient My Uniform Assistant webcomponent on server $2, slot $3"
            export ABSMESSAGE="Generating properties for WebClient My Uniform Assistant webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then        
                WEBXMLPATH="$4/deploy/wua/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"49"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            export ABSMESSAGE="     Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
				sed -i "/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
				ssh -n -q $2 "sed -i '/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wua X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
			;;

		wrd)
            echo "Generating properties for WebClient Residential Delivery webcomponent on server $2, slot $3"
            export ABSMESSAGE="Generating properties for WebClient Residential Delivery webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then        
                WEBXMLPATH="$4/deploy/wrd/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"50"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            export ABSMESSAGE="     Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
				sed -i "/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
				ssh -n -q $2 "sed -i '/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wrd X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
			;;

		wrr)
            echo "Generating properties for WebClientRouteReturns webcomponent on server $2, slot $3"
            export ABSMESSAGE="Generating properties for WebClientRouteReturns webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then        
                WEBXMLPATH="$4/deploy/wrr/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"51"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            export ABSMESSAGE="     Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
				sed -i "/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
				ssh -n -q $2 "sed -i '/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wrr X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
			;;
			
		wfb)
            echo "Generating properties for absmobilefirebaseservices webcomponent on server $2, slot $3"
            export ABSMESSAGE="       Generating properties for absmobilefirebaseservices webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then        
                WEBXMLPATH="$4/deploy/wfb/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"52"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            export ABSMESSAGE="       Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
				sed -i "/userName/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$5\3/;}" $WEBXML
                sed -i "/password/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$6\3/;}" $WEBXML
				sed -i "/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
				echo -n .
                ssh -n -q $2 "sed -i '/userName/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$5\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/password/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$6\3/;}' $WEBXML"
                echo -n .
				ssh -n -q $2 "sed -i '/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wfb X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
			;;

        wsb)
            echo "Generating properties for WebClient Replace Smart Barcode webcomponent on server $2, slot $3"
            export ABSMESSAGE="Generating properties for WebClient Replace Smart Barcode webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then
                WEBXMLPATH="$4/deploy/wsb/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"53"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            export ABSMESSAGE="     Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ]
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
                                sed -i "/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
            fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wsb X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
            ;;

        wmr)
            echo "Generating properties for REST webcomponent on server $2, slot $3"
            export ABSMESSAGE="       Generating properties for REST webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then
                WEBXMLPATH="$4/deploy/wmr/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"54"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            export ABSMESSAGE="       Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ]
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
                sed -i "/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
                sed -i "/systemUserLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$5\3/;}" $WEBXML
                sed -i "/passwordLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$6\3/;}" $WEBXML
                sed -i "/stationNumberLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
                sed -i "/systemUserGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${16}\3/;}" $WEBXML
                sed -i "/passwordGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${17}\3/;}" $WEBXML
                sed -i "/stationNumberGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${18}\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/systemUserLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$5\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/passwordLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$6\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/stationNumberLA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/systemUserGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${16}\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/passwordGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${17}\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/stationNumberGA/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1${18}\3/;}' $WEBXML"
                echo ';'
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
             fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wmr X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
			;;

		wcp)
            echo "Generating properties for absmobilefirebaseservices webcomponent on server $2, slot $3"
            export ABSMESSAGE="       Generating properties for absmobilefirebaseservices webcomponent on server $2, slot $3"
            absmenu_log
            if [ "$8" == "deploy" ]
            then        
                WEBXMLPATH="$4/deploy/wcp/WEB-INF"
            else
                WEBXMLPATH="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/applications/${13}/WEB-INF"
            fi
            WEBXML="$WEBXMLPATH/web.xml"
            SNMPFILE="$WEBXMLPATH/AbsSnmpAgentSettings.properties"
            V_SNMPPORT="5"$SLOTNR"55"
			SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE
            export ABSMESSAGE="       Generating $WEBXML"; absmenu_log
            #WEBLOGDIR="$4/$GLASSFISHPATH/glassfish/domains/$ABSM_GFDOMAIN/log"
            if [ "$ABS_ROOTSERVER" == "$2" ] 
            then
                [ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML
                [ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML
                sed -i "/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}" $WEBXML
                sed -i "/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}" $WEBXML
				sed -i "/userName/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$5\3/;}" $WEBXML
                sed -i "/password/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$6\3/;}" $WEBXML
                sed -i "/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}" $WEBXML
            else
                echo -n .
                ssh -n -q $2 "[ ! -e $WEBXMLPATH/sample_web.xml ] && [ -e $WEBXMLPATH/web.NEW.xml ] && cp $WEBXMLPATH/web.NEW.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "[ -e $WEBXMLPATH/sample_web.xml ] && cp $WEBXMLPATH/sample_web.xml $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsServer/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_APPSRV\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/nsPort/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$V_NSPORT\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/userName/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$5\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/password/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$6\3/;}' $WEBXML"
                echo -n .
                ssh -n -q $2 "sed -i '/stationNumber/ { N;s/\(.*<param-value>\)\(.*\)\(<\/param-value>.*\)/\1$7\3/;}' $WEBXML"
                echo -n .
            fi
            if [ -e "$WEBXMLPATH/sample_AbsSnmpAgentSettings.properties" ]
            then
                if [ "$ABS_ROOTSERVER" == "$2" ] 
                then
                    cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                    sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT" $SNMPFILE
                    sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
					sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD" $SNMPFILE
                else
                    echo -n .
                    ssh -n -q $2 "cp $WEBXMLPATH/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$2/$V_SNMPPORT' $SNMPFILE"
                    echo -n .
                    ssh -n -q $2 "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
					echo -n .
                    ssh -n -q $2 "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIOD' $SNMPFILE"
                    echo ';'
                fi
            else
                generate_snmp "$SNMPFILE" "$2" "$V_SNMPPORT" "$SNMPAGENTTIMERPERIOD"
			fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$2" wcp X X X X "$SNMPFILE" "$LOG4JFILE" "$WEBXML" "$FACESXML" "$SUNWEBXML"
			;;
    esac
}

create_properties()
{
    ABSM_ENVIRONMENT="$1"
    DOCHECK="$2"
    ABSM_TYPE="$3"
    ABSM_SERVERNAME="$4"
    ABSM_SLOT="$5"
    ABSM_LOCAL_HOME="$6"
    ABSM_USER="$7"
    ABSM_PWD="$8"
    ABSM_STATIONNR="$9"
    ABSM_CONNAPPSRV="${10}"
    ABSM_CONNAPPSLOT="${11}"
    ABSM_CONNREPSRV="${12}"
    ABSM_CONNREPSLOT="${13}"
    ABSM_WEBNAME="${14}"
    ABSM_ORATNS="${15}"
    ABSM_ORAHOME="${16}"
    ABSM_USER="${17}"
    ABSM_PWD="${18}"
    ABSM_STATIONNR2="${19}"
    ABSM_USENATIVE="${20}"
    ABSM_INET_KEY="${21}"
    ABSM_GFDOMAIN="${22}"
    ABSM_USER2="${23}"
    ABSM_PWD2="${24}"
    ABSM_STATIONNR2="${25}"
    ABSM_DBSERVERNAME="${26}"
    ABSM_DBDRIVERTYPE="${27}"
    ABSM_DBPORTNUMBER="${28}"

    # make sure the slot length is 2 characters. This is necessary to determine the correct portnumbers
    [ ${#ABSM_SLOT} == "1" ] && ABSM_SLOT="0"$ABSM_SLOT
    [ ${#ABSM_CONNAPPSLOT} == "1" ] && ABSM_CONNAPPSLOT="0"$ABSM_CONNAPPSLOT
    [ ${#ABSM_CONNREPSLOT} == "1" ] && ABSM_CONNREPSLOT="0"$ABSM_CONNREPSLOT

    case "$ABSM_TYPE" in
        app)
            PROPERTIESFILE="$ABSM_LOCAL_HOME/Server/Config/absserver.properties"
			[ -e $ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Server/Config/sample_application.properties ] && PROPERTIESFILE="$ABSM_LOCAL_HOME/Server/Config/application.properties"
            SNMPFILE="$ABSM_LOCAL_HOME/Server/Config/AbsSnmpAgentSettings.properties"
            if [ -e "$ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Server/Config/log4j2.xml" ] 
			then
				LOG4JFILE="$ABSM_LOCAL_HOME/Server/Config/log4j2.xml"
			else
				LOG4JFILE="$ABSM_LOCAL_HOME/Server/Config/log4j.properties"
			fi
            echo "Generating properties for application server instance on server $ABSM_SERVERNAME, slot $ABSM_SLOT"
            export ABSMESSAGE="Generating properties for application server instance on server $ABSM_SERVERNAME, slot $ABSM_SLOT"
            absmenu_log
			echo ABSMESSAGE="     Check $ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Server/Config/sample_application.properties from repository"; absmenu_log
            export ABSMESSAGE="     Copy $PROPERTIESFILE from repository"; absmenu_log
            if [ "$ABS_ROOTSERVER" == "$ABSMENUREPOSITORYSERVER" ] 
            then
                rsync -tav --delete -e "ssh -q" $ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Server/Config/ $ABSM_SERVERNAME:$ABSM_LOCAL_HOME/Server/Config
			else
                ssh -n -q $ABSMENUREPOSITORYSERVER "rsync -tav --delete -e \"ssh -q\" $ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Server/Config/ $ABSM_SERVERNAME:$ABSM_LOCAL_HOME/Server/Config"
			fi                 
            GENPROPOK=yes
            if [ "$DOCHECK" == check ]
            then
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    [ -e $PROPERTIESFILE ] && GENPROPOK=no
                else
                    [ `ssh -q -n $ABSM_SERVERNAME "[ -e $PROPERTIESFILE ] && echo 1"` ] && GENPROPOK=no
                fi
            fi
            if [ "$GENPROPOK" == yes ]
            then
                echo "     GENPROPOK is $GENPROPOK"; absmenu_log
                export ABSMESSAGE="     Generating $PROPERTIESFILE"; absmenu_log
                V_NSPORT="5"$ABSM_SLOT"11"
                V_PORTUNIQUESERVER="5"$ABSM_SLOT"12"
                V_NSREPORTSERVERRMIPORT="5"$ABSM_CONNREPSLOT"21"
                V_NSREPORTSERVERHTTPPORT="5"$ABSM_CONNREPSLOT"22"
                V_RMISERVERSOCKETPORT="5"$ABSM_SLOT"15"
				V_RMIDIAGNOSTICPORT="5"$ABSM_SLOT"16"
                V_RESTENDPOINTPORT="5"$ABSM_SLOT"17"
				OCI8THIN=`echo "$ABSM_DBDRIVERTYPE" | tr '[:upper:]' '[:lower:]'`
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    # cp $ABSM_LOCAL_HOME/Server/Config/sample_absserver.properties $PROPERTIESFILE
					FILE=$ABSM_LOCAL_HOME/Server/Config/sample_application.properties
					if [ -e "$FILE" ]
					then
						cp $ABSM_LOCAL_HOME/Server/Config/sample_application.properties $PROPERTIESFILE
						if [ -e $ABSM_LOCAL_HOME/Server/Config/absserver.properties ]
						then
						   rm $ABSM_LOCAL_HOME/Server/Config/absserver.properties
						fi
					else 
						cp $ABSM_LOCAL_HOME/Server/Config/sample_absserver.properties $PROPERTIESFILE
					fi
					if [ $ABSSOLUTENUMVERSION -ge 90902 ]
					then
						sed -i "/^server.port=/ c\server.port=$V_RESTENDPOINTPORT" $PROPERTIESFILE
					else
						sed -i "/^abs.restEndpoint.port=/ c\abs.restEndpoint.port=$V_RESTENDPOINTPORT" $PROPERTIESFILE
					fi
                    sed -i "/^NSHost=/ c\NSHost=$ABSM_SERVERNAME" $PROPERTIESFILE
                    sed -i "/^NSPort=/ c\NSPort=$V_NSPORT" $PROPERTIESFILE
                    sed -i "/^PortUniqueServer=/ c\PortUniqueServer=$V_PORTUNIQUESERVER" $PROPERTIESFILE
                    sed -i "/^NSReportServerHost=/ c\NSReportServerHost=$ABSM_CONNREPSRV" $PROPERTIESFILE
                    sed -i "/^NSReportServerRMIPort=/ c\NSReportServerRMIPort=$V_NSREPORTSERVERRMIPORT" $PROPERTIESFILE
                    sed -i "/^NSReportServerHTTPPort=/ c\NSReportServerHTTPPort=$V_NSREPORTSERVERHTTPPORT" $PROPERTIESFILE
                    sed -i "/^RMISERVERSOCKETPORT=/ c\RMISERVERSOCKETPORT=$V_RMISERVERSOCKETPORT" $PROPERTIESFILE
					sed -i "/^RMIDIAGNOSTICPORT=/ c\RMIDIAGNOSTICPORT=$V_RMIDIAGNOSTICPORT" $PROPERTIESFILE
                    sed -i "/^DBServerName=/ c\DBServerName=$ABSM_DBSERVERNAME" $PROPERTIESFILE
                    sed -i "/^DBPortNumber=/ c\DBPortNumber=$ABSM_DBPORTNUMBER" $PROPERTIESFILE
                    sed -i "/^DBSID=/ c\DBSID=$ABSM_ORATNS" $PROPERTIESFILE
                    sed -i "/^DBUser=/ c\DBUser=$ABSM_USER" $PROPERTIESFILE
                    sed -i "/^DBPassword=/ c\DBPassword=$ABSM_PWD" $PROPERTIESFILE
                    sed -i "/^OracleHome=/ c\OracleHome=$ABSM_ORAHOME" $PROPERTIESFILE
					if [ "$OCI8THIN" == "rac" ]
                    then
                        sed -i "/^DBDriverType=/ c\DBDriverType=thin" $PROPERTIESFILE
						sed -i "/^DBThinURL=/ c\DBThinURL=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER/$ABSM_ORATNS" $PROPERTIESFILE
                    else
                        sed -i "/^DBDriverType=/ c\DBDriverType=$OCI8THIN" $PROPERTIESFILE
                    fi
                else
                    echo -n .
                    # ssh -n -q $ABSM_SERVERNAME "cp $ABSM_LOCAL_HOME/Server/Config/sample_absserver.properties $PROPERTIESFILE"
					FILE=$ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Server/Config/sample_application.properties
					if [ -e "$FILE" ]; then
						ssh -n -q $ABSM_SERVERNAME "cp $ABSM_LOCAL_HOME/Server/Config/sample_application.properties $PROPERTIESFILE"
					else 
						ssh -n -q $ABSM_SERVERNAME "cp $ABSM_LOCAL_HOME/Server/Config/sample_absserver.properties $PROPERTIESFILE"
					fi
					echo -n .
					if [ $ABSSOLUTENUMVERSION -ge 90902 ]
					then					
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^server.port=/ c\server.port=$V_RESTENDPOINTPORT' $PROPERTIESFILE"
					else
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^abs.restEndpoint.port=/ c\abs.restEndpoint.port=$V_RESTENDPOINTPORT' $PROPERTIESFILE"
					fi
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^NSHost=/ c\NSHost=$ABSM_SERVERNAME' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^NSPort=/ c\NSPort=$V_NSPORT' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^PortUniqueServer=/ c\PortUniqueServer=$V_PORTUNIQUESERVER' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^NSReportServerHost=/ c\NSReportServerHost=$ABSM_CONNREPSRV' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^NSReportServerRMIPort=/ c\NSReportServerRMIPort=$V_NSREPORTSERVERRMIPORT' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^NSReportServerHTTPPort=/ c\NSReportServerHTTPPort=$V_NSREPORTSERVERHTTPPORT' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^RMISERVERSOCKETPORT=/ c\RMISERVERSOCKETPORT=$V_RMISERVERSOCKETPORT' $PROPERTIESFILE"
                    echo -n .
					ssh -n -q $ABSM_SERVERNAME "sed -i '/^RMIDIAGNOSTICPORT=/ c\RMIDIAGNOSTICPORT=$V_RMIDIAGNOSTICPORT' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBServerName=/ c\DBServerName=$ABSM_DBSERVERNAME' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBPortNumber=/ c\DBPortNumber=$ABSM_DBPORTNUMBER' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBSID=/ c\DBSID=$ABSM_ORATNS' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBUser=/ c\DBUser=$ABSM_USER' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBPassword=/ c\DBPassword=$ABSM_PWD' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^OracleHome=/ c\OracleHome=$ABSM_ORAHOME' $PROPERTIESFILE"
					echo -n .
					if [ "$OCI8THIN" == "rac" ]
					then
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBDriverType=/ c\DBDriverType=thin' $PROPERTIESFILE"
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBThinURL=/ c\DBThinURL=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER/$ABSM_ORATNS' $PROPERTIESFILE"
                    else
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBDriverType=/ c\DBDriverType=$OCI8THIN' $PROPERTIESFILE"
                    fi
                    echo ';'
                fi
            else
                export ABSMESSAGE="     Skipped generating $PROPERTIESFILE (already exists)"; absmenu_log
            fi
            GENPROPOK=yes
            if [ "$DOCHECK" == check ]
            then
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    [ -e $SNMPFILE ] && GENPROPOK=no
                else
                    [ `ssh -q -n $ABSM_SERVERNAME "[ -e $SNMPFILE ] && echo 1"` ] && GENPROPOK=no
                fi
            fi
            if [ "$GENPROPOK" == yes ]
            then
                export ABSMESSAGE="     Generating $SNMPFILE"; absmenu_log
                V_SNMPPORT="5"$ABSM_SLOT"14"
                if [ -e "$ABSM_LOCAL_HOME/Server/Config/sample_AbsSnmpAgentSettings.properties" ]
                then
                    if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                    then
                        cp $ABSM_LOCAL_HOME/Server/Config/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                        sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$ABSM_SERVERNAME/$V_SNMPPORT" $SNMPFILE
						sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE" $SNMPFILE
                        sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
                    else
                        echo -n .
                        ssh -n -q $ABSM_SERVERNAME "cp $ABSM_LOCAL_HOME/Server/Config/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                        echo -n .
                        ssh -n -q $ABSM_SERVERNAME "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$ABSM_SERVERNAME/$V_SNMPPORT' $SNMPFILE"
                        echo -n .
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE' $SNMPFILE"
                        echo -n .
                        ssh -n -q $ABSM_SERVERNAME "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
                        echo ';'
                    fi
                else
                    generate_snmp "$SNMPFILE" "$ABSM_SERVERNAME" "$V_SNMPPORT"
                fi
            else
                export ABSMESSAGE="     Skipped generating $SNMPFILE (already exists)"; absmenu_log
            fi
            GENPROPOK=yes
            if [ "$DOCHECK" == check ]
            then
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    [ -e $LOG4JFILE ] && GENPROPOK=no
                else
                    [ `ssh -q -n $ABSM_SERVERNAME "[ -e $LOG4JFILE ] && echo 1"` ] && GENPROPOK=no
                fi
            fi
            if [ "$GENPROPOK" == yes ]
            then
                export ABSMESSAGE="     Generating $LOG4JFILE"; absmenu_log
                V_LOGDIR="$ABSM_LOCAL_HOME/Server/Log"
                if [ -e "$ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Server/Config/log4j2.xml" ]
				then
					export ABSMESSAGE="     Skipped generating $LOG4JFILE (already exists)"; absmenu_log
				else
					if [ -e "$ABSM_LOCAL_HOME/Server/Config/sample_log4j.properties" ]
					then
						if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
						then
							cp $ABSM_LOCAL_HOME/Server/Config/sample_log4j.properties $LOG4JFILE
							sed -i "/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$V_LOGDIR/ABSServerLog.log" $LOG4JFILE
							sed -i "/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$V_LOGDIR/ABSServerRollingLog.log" $LOG4JFILE
						else
							echo -n .
							ssh -n -q $ABSM_SERVERNAME "cp $ABSM_LOCAL_HOME/Server/Config/sample_log4j.properties $LOG4JFILE"
							echo -n .
							ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$V_LOGDIR/ABSServerLog.log' $LOG4JFILE"
							echo -n .
							ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$V_LOGDIR/ABSServerRollingLog.log' $LOG4JFILE"
							echo ';'
						fi
					else
						generate_log4j $LOG4JFILE $ABSM_SERVERNAME $V_LOGDIR Server
					fi
				fi
            else
                export ABSMESSAGE="     Skipped generating $LOG4JFILE (already exists)"; absmenu_log
            fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$ABSM_SERVERNAME" app "$PROPERTIESFILE" X X X "$SNMPFILE" "$LOG4JFILE" X X X
			;;
			
        rep)
            PROPERTIESFILE="$ABSM_LOCAL_HOME/Reportserver/Config/Reportserver.properties"
            CRYSTALCLEARFILE="$ABSM_LOCAL_HOME/Reportserver/Config/crystalclear.properties"
            SNMPFILE="$ABSM_LOCAL_HOME/Reportserver/Config/AbsSnmpAgentSettings.properties"
            if [ -e "$ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Reportserver/Config/log4j2.xml" ] 
			then
				LOG4JFILE="$ABSM_LOCAL_HOME/Reportserver/Config/log4j2.xml"
			else
				LOG4JFILE="$ABSM_LOCAL_HOME/Reportserver/Config/log4j.properties"
			fi
            echo "Generating properties for report server instance on server $ABSM_SERVERNAME, slot $ABSM_SLOT"
            export ABSMESSAGE="Generating properties for report server instance on server $ABSM_SERVERNAME, slot $ABSM_SLOT"
            export ABSMESSAGE="     Copy sample_properties from repository"; absmenu_log
            if [ "$ABS_ROOTSERVER" == "$ABSMENUREPOSITORYSERVER" ] 
            then
                rsync -tav --delete -e "ssh -q" $ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Reportserver/Config/* $ABSM_SERVERNAME:$ABSM_LOCAL_HOME/Reportserver/Config*
            else
                ssh -n -q $ABSMENUREPOSITORYSERVER "rsync -tav --delete -e \"ssh -q\" $ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Reportserver/Config/* $ABSM_SERVERNAME:$ABSM_LOCAL_HOME/Reportserver/Config/*"
            fi
            GENPROPOK=yes
            if [ "$DOCHECK" == check ]
            then
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    [ -e $PROPERTIESFILE ] && GENPROPOK=no
                else
                    [ `ssh -q -n $ABSM_SERVERNAME "[ -e $PROPERTIESFILE ] && echo 1"` ] && GENPROPOK=no
                fi
            fi
            if [ "$GENPROPOK" == yes ]
            then
                export ABSMESSAGE="     Generating $PROPERTIESFILE"; absmenu_log
                V_NSPORT="5"$ABSM_SLOT"21"
                V_LISTENERPORT="5"$ABSM_SLOT"22"
                V_RMISERVERSOCKETPORTMIN="5"$ABSM_SLOT"25"
                V_RMISERVERSOCKETPORTMAX="5"$ABSM_SLOT"25"
				OCI8THIN=`echo "$ABSM_DBDRIVERTYPE" | tr '[:upper:]' '[:lower:]'`
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    cp $ABSM_LOCAL_HOME/Reportserver/Config/sample_ReportServer.properties $PROPERTIESFILE
                    sed -i "/^NSReportServerHost=/ c\NSReportServerHost=$ABSM_SERVERNAME" $PROPERTIESFILE
                    sed -i "/^NSReportServerRMIPort=/ c\NSReportServerRMIPort=$V_NSPORT" $PROPERTIESFILE
                    sed -i "/^NSReportServerHTTPPort=/ c\NSReportServerHTTPPort=$V_LISTENERPORT" $PROPERTIESFILE
                    sed -i "/^RMISERVERSOCKETPORTMIN=/ c\RMISERVERSOCKETPORTMIN=$V_RMISERVERSOCKETPORTMIN" $PROPERTIESFILE
                    sed -i "/^RMISERVERSOCKETPORTMAX=/ c\RMISERVERSOCKETPORTMAX=$V_RMISERVERSOCKETPORTMAX" $PROPERTIESFILE
                    sed -i "/^ReportsPath=/ c\ReportsPath=$ABSM_LOCAL_HOME/Reportserver/CrReports" $PROPERTIESFILE
                else
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "cp $ABSM_LOCAL_HOME/Reportserver/Config/sample_ReportServer.properties $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^NSReportServerHost=/ c\NSReportServerHost=$ABSM_SERVERNAME' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^NSReportServerRMIPort=/ c\NSReportServerRMIPort=$V_NSPORT' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^NSReportServerHTTPPort=/ c\NSReportServerHTTPPort=$V_LISTENERPORT' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^RMISERVERSOCKETPORTMIN=/ c\RMISERVERSOCKETPORTMIN=$V_RMISERVERSOCKETPORTMIN' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^RMISERVERSOCKETPORTMAX=/ c\RMISERVERSOCKETPORTMAX=$V_RMISERVERSOCKETPORTMAX' $PROPERTIESFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^ReportsPath=/ c\ReportsPath=$ABSM_LOCAL_HOME/Reportserver/CrReports' $PROPERTIESFILE"
                    echo ';'
                fi
				if [ "$LOG4JFILE" == "$ABSM_LOCAL_HOME/Reportserver/Config/log4j2.xml" ]
                then
                    if [ "$OCI8THIN" == "rac" ]
                    then
                        if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ]
                        then
							sed -i "/^DBUser=/ c\DBUser=$ABSM_USER" $PROPERTIESFILE
							sed -i "/^DBPassword=/ c\DBPassword=$ABSM_PWD" $PROPERTIESFILE
							sed -i "/^DBThinURL=/ c\DBThinURL=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER/$ABSM_ORATNS" $PROPERTIESFILE
						else
							ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBUser=/ c\DBUser=$ABSM_USER' $PROPERTIESFILE"
							ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBPassword=/ c\DBPassword=$ABSM_PWD' $PROPERTIESFILE"
							ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBThinURL=/ c\DBThinURL=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER/$ABSM_ORATNS' $PROPERTIESFILE"
						fi
					else
						if [ "$OCI8THIN" == "thin" ]
						then
							if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ]
							then
								sed -i "/^DBUser=/ c\DBUser=$ABSM_USER" $PROPERTIESFILE
								sed -i "/^DBPassword=/ c\DBPassword=$ABSM_PWD" $PROPERTIESFILE
								sed -i "/^DBThinURL=/ c\DBThinURL=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER:$ABSM_ORATNS" $PROPERTIESFILE
							else
								ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBUser=/ c\DBUser=$ABSM_USER' $PROPERTIESFILE"
								ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBPassword=/ c\DBPassword=$ABSM_PWD' $PROPERTIESFILE"
								ssh -n -q $ABSM_SERVERNAME "sed -i '/^DBThinURL=/ c\DBThinURL=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER:$ABSM_ORATNS' $PROPERTIESFILE"
							fi
						fi
					fi
				else
					if [ "$LOG4JFILE" == "$ABSM_LOCAL_HOME/Reportserver/Config/log4j.properties" ]
					then
						sed -i "/^oracle.properties=/ c\oracle.properties=user=$ABSM_USER&password=$ABSM_PWD" $CRYSTALCLEARFILE
						case "$OCI8THIN" in
							thin)           sed -i "/^oracle.url=/ c\oracle.url=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER:$ABSM_ORATNS" $CRYSTALCLEARFILE ;;
							rac)            sed -i "/^oracle.url=/ c\oracle.url=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER/$ABSM_ORATNS" $CRYSTALCLEARFILE ;;
							*)              sed -i "/^oracle.url=/ c\oracle.url=jdbc:oracle:oci8:@$ABSM_ORATNS" $CRYSTALCLEARFILE ;;
						esac
					else
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^oracle.properties=/ c\oracle.properties=user=$ABSM_USER&password=$ABSM_PWD' $CRYSTALCLEARFILE"
						case "$OCI8THIN" in
							thin)           ssh -n -q $ABSM_SERVERNAME "sed -i '/^oracle.url=/ c\oracle.url=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER:$ABSM_ORATNS' $CRYSTALCLEARFILE" ;;
							rac)            ssh -n -q $ABSM_SERVERNAME "sed -i '/^oracle.url=/ c\oracle.url=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER/$ABSM_ORATNS' $CRYSTALCLEARFILE" ;;
							*)              ssh -n -q $ABSM_SERVERNAME "sed -i '/^oracle.url=/ c\oracle.url=jdbc:oracle:oci8:@$ABSM_ORATNS' $CRYSTALCLEARFILE" ;;
						esac
					fi
				fi
            else
                export ABSMESSAGE="     Skipped generating $PROPERTIESFILE (already exists)"; absmenu_log
            fi
            GENPROPOK=yes
            if [ "$DOCHECK" == check ]
            then
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    [ -e $CRYSTALCLEARFILE ] && GENPROPOK=no
                else
                    [ `ssh -q -n $ABSM_SERVERNAME "[ -e $CRYSTALCLEARFILE ] && echo 1"` ] && GENPROPOK=no
                fi
            fi
            if [ "$GENPROPOK" == yes ]
            then
                export ABSMESSAGE="     Generating $CRYSTALCLEARFILE"; absmenu_log
                V_INETPORT="5"$ABSM_SLOT"22"
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    cp $ABSM_LOCAL_HOME/Reportserver/Config/sample_crystalclear.properties $CRYSTALCLEARFILE
                    sed -i "/^OnError_ExecuteSQL_WithoutSF=/ c\OnError_ExecuteSQL_WithoutSF=false" $CRYSTALCLEARFILE
                    sed -i "/^listener.port=/ c\listener.port=$V_INETPORT" $CRYSTALCLEARFILE
                    sed -i "/^licensekey=/ c\licensekey=$ABSM_INET_KEY" $CRYSTALCLEARFILE
					sed -i "/^oracle.properties=/ c\oracle.properties=user=$ABSM_USER&password=$ABSM_PWD" $CRYSTALCLEARFILE
                    sed -i "/^UseNativeFonts=/ c\UseNativeFonts=$ABSM_USENATIVE" $CRYSTALCLEARFILE
                    sed -i "/^FontPath=/ c\FontPath=$ABSM_LOCAL_HOME/Reportserver/Fonts" $CRYSTALCLEARFILE
                    sed -i "/^coreFile=/ c\coreFile=$ABSM_LOCAL_HOME/Reportserver/Log/ccore" $CRYSTALCLEARFILE
                    sed -i "/^log.file=/ c\log.file=$ABSM_LOCAL_HOME/Reportserver/Log/cc.log" $CRYSTALCLEARFILE
                    sed -i "/^EnableBindVariables=/ c\EnableBindVariables=true" $CRYSTALCLEARFILE
                    sed -i "/^rowSourceCache.enabled=/ c\rowSourceCache.enabled=false" $CRYSTALCLEARFILE
					case "$OCI8THIN" in
						thin)		sed -i "/^oracle.url=/ c\oracle.url=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER:$ABSM_ORATNS" $CRYSTALCLEARFILE ;;
						rac) 		sed -i "/^oracle.url=/ c\oracle.url=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER/$ABSM_ORATNS" $CRYSTALCLEARFILE ;;
						*)   		sed -i "/^oracle.url=/ c\oracle.url=jdbc:oracle:oci8:@$ABSM_ORATNS" $CRYSTALCLEARFILE ;;
					esac
				else
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "cp $ABSM_LOCAL_HOME/Reportserver/Config/sample_crystalclear.properties $CRYSTALCLEARFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^OnError_ExecuteSQL_WithoutSF=/ c\OnError_ExecuteSQL_WithoutSF=false' $CRYSTALCLEARFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^listener.port=/ c\listener.port=$V_INETPORT' $CRYSTALCLEARFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^licensekey=/ c\licensekey=$ABSM_INET_KEY' $CRYSTALCLEARFILE"
                    echo -n .
					ssh -n -q $ABSM_SERVERNAME "sed -i '/^oracle.properties=/ c\oracle.properties=user=$ABSM_USER&password=$ABSM_PWD' $CRYSTALCLEARFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^UseNativeFonts=/ c\UseNativeFonts=$ABSM_USENATIVE' $CRYSTALCLEARFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^FontPath=/ c\FontPath=$ABSM_LOCAL_HOME/Reportserver/Fonts' $CRYSTALCLEARFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^coreFile=/ c\coreFile=$ABSM_LOCAL_HOME/Reportserver/Log/ccore' $CRYSTALCLEARFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^log.file=/ c\log.file=$ABSM_LOCAL_HOME/Reportserver/Log/cc.log' $CRYSTALCLEARFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^EnableBindVariables=/ c\EnableBindVariables=true' $CRYSTALCLEARFILE"
                    echo -n .
                    ssh -n -q $ABSM_SERVERNAME "sed -i '/^rowSourceCache.enabled=/ c\rowSourceCache.enabled=false' $CRYSTALCLEARFILE"
                    echo -n .
					case "$OCI8THIN" in
						thin)		ssh -n -q $ABSM_SERVERNAME "sed -i '/^oracle.url=/ c\oracle.url=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER:$ABSM_ORATNS' $CRYSTALCLEARFILE" ;;
						rac) 		ssh -n -q $ABSM_SERVERNAME "sed -i '/^oracle.url=/ c\oracle.url=jdbc:oracle:thin:@$ABSM_DBSERVERNAME:$ABSM_DBPORTNUMBER/$ABSM_ORATNS' $CRYSTALCLEARFILE" ;;
						*)   		ssh -n -q $ABSM_SERVERNAME "sed -i '/^oracle.url=/ c\oracle.url=jdbc:oracle:oci8:@$ABSM_ORATNS' $CRYSTALCLEARFILE" ;;
					esac
					echo ';'
                fi
            else
                export ABSMESSAGE="     Skipped generating $CRYSTALCLEARFILE (already exists)"; absmenu_log
            fi
            GENPROPOK=yes
            if [ "$DOCHECK" == check ]
            then
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    [ -e $SNMPFILE ] && GENPROPOK=no
                else
                    [ `ssh -q -n $ABSM_SERVERNAME "[ -e $SNMPFILE ] && echo 1"` ] && GENPROPOK=no
                fi
            fi
            if [ "$GENPROPOK" == yes ]
            then
                export ABSMESSAGE="     Generating $SNMPFILE"; absmenu_log
                V_SNMPPORT="5"$ABSM_SLOT"24"
                if [ -e "$ABSM_LOCAL_HOME/Reportserver/Config/sample_AbsSnmpAgentSettings.properties" ]
                then
                    if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                    then
                        cp $ABSM_LOCAL_HOME/Reportserver/Config/sample_AbsSnmpAgentSettings.properties $SNMPFILE
                        sed -i "/^NMSADDRESS=/ c\NMSADDRESS=$ABSM_SERVERNAME/$V_SNMPPORT" $SNMPFILE
						sed -i "/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE" $SNMPFILE
                        sed -i "/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS" $SNMPFILE
                    else
                        echo -n .
                        ssh -n -q $ABSM_SERVERNAME "cp $ABSM_LOCAL_HOME/Reportserver/Config/sample_AbsSnmpAgentSettings.properties $SNMPFILE"
                        echo -n .
                        ssh -n -q $ABSM_SERVERNAME "sed -i '/^NMSADDRESS=/ c\NMSADDRESS=$ABSM_SERVERNAME/$V_SNMPPORT' $SNMPFILE"
						echo -n .
						ssh -n -q $ABSM_SERVERNAME "sed -i '/^SNMPAGENTTIMERPERIOD=/ c\SNMPAGENTTIMERPERIOD=$SNMPAGENTTIMERPERIODVALUE' $SNMPFILE"
                        echo -n .
                        ssh -n -q $ABSM_SERVERNAME "sed -i '/^TARGETADDRESS=/ c\TARGETADDRESS=$SNMPTARGETADDRESS' $SNMPFILE"
                        echo ';'
                    fi
                else
                    generate_snmp "$SNMPFILE" "$ABSM_SERVERNAME" "$V_SNMPPORT"
                fi
            else
                export ABSMESSAGE="     Skipped generating $SNMPFILE (already exists)"; absmenu_log
            fi

            GENPROPOK=yes
            if [ "$DOCHECK" == check ]
            then
                if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
                then
                    [ -e $LOG4JFILE ] && GENPROPOK=no
                else
                    [ `ssh -q -n $ABSM_SERVERNAME "[ -e $LOG4JFILE ] && echo 1"` ] && GENPROPOK=no
                fi
            fi
            if [ "$GENPROPOK" == yes ]
            then
                export ABSMESSAGE="     Generating $LOG4JFILE"; absmenu_log
                V_LOGDIR="$ABSM_LOCAL_HOME/Reportserver/Log"
                if [ -e "$ABSMENUREPOSITORYLOCATION/$ABSMENU_CURRENT_ENVIRONMENT/Future/Server/Config/log4j2.xml" ]
				then
					export ABSMESSAGE="     Skipped generating $LOG4JFILE (already exists)"; absmenu_log
				else
					if [ -e "$ABSM_LOCAL_HOME/Reportserver/Config/sample_log4j.properties" ]
                	then
						if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
						then
							cp $ABSM_LOCAL_HOME/Reportserver/Config/sample_log4j.properties $LOG4JFILE
							sed -i "/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$V_LOGDIR/ABSReportServerLog.log" $LOG4JFILE
							sed -i "/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$V_LOGDIR/ABSServerRollingLog.log" $LOG4JFILE
						else
							echo -n .
							ssh -n -q $ABSM_SERVERNAME "cp $ABSM_LOCAL_HOME/Reportserver/Config/sample_log4j.properties $LOG4JFILE"
							echo -n .
							ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.FILEAPPENDER.File=/ c\log4j.appender.FILEAPPENDER.File=$V_LOGDIR/ABSReportServerLog.log' $LOG4JFILE"
							echo -n .
							ssh -n -q $ABSM_SERVERNAME "sed -i '/^log4j.appender.ROLLINGAPPENDER.File=/ c\log4j.appender.ROLLINGAPPENDER.File=$V_LOGDIR/ABSServerRollingLog.log' $LOG4JFILE"
							echo ';'
						fi
					else
						generate_log4j $LOG4JFILE $ABSM_SERVERNAME $V_LOGDIR ReportServer
					fi
				fi
            else
                export ABSMESSAGE="     Skipped generating $LOG4JFILE (already exists)"; absmenu_log
            fi
            HandleCustomProperties "$ABSM_ENVIRONMENT" "$ABSM_SERVERNAME" rep X "$PROPERTIESFILE" "$CRYSTALCLEARFILE" X "$SNMPFILE" "$LOG4JFILE" X X X
            if [ "$ABS_ROOTSERVER" == "$ABSM_SERVERNAME" ] 
            then
                [ -e "$ABSM_LOCAL_HOME/Reportserver/Config/ReportServer.properties" ] && rm -f "$ABSM_LOCAL_HOME/Reportserver/Config/ReportServer.properties"
                ln -s "$PROPERTIESFILE" "$ABSM_LOCAL_HOME/Reportserver/Config/ReportServer.properties"
            else
                ssh -n -q $ABSM_SERVERNAME "[ -e \"$ABSM_LOCAL_HOME/Reportserver/Config/ReportServer.properties\" ] && rm -f \"$ABSM_LOCAL_HOME/Reportserver/Config/ReportServer.properties\""
                ssh -n -q $ABSM_SERVERNAME "ln -s \"$PROPERTIESFILE\" \"$ABSM_LOCAL_HOME/Reportserver/Config/ReportServer.properties\""
            fi
			;;

		gws|w4m|wp2|wsr|wum|wcl|wua|wrd|wrr|wsb|wmr|wfb|wcp)
            do_web_config "$ABSM_TYPE" "$ABSM_SERVERNAME" "$ABSM_SLOT" "$ABSM_LOCAL_HOME" "$ABSM_USER" "$ABSM_PWD" "$ABSM_STATIONNR" normal "$ABSM_CONNAPPSRV" "$ABSM_CONNAPPSLOT" "$ABSM_CONNREPSRV" "$ABSM_CONNREPSLOT" "$ABSM_WEBNAME" "$ABSM_ENVIRONMENT" "$ABSM_GFDOMAIN" "$ABSM_USER2" "$ABSM_PWD2" "$ABSM_STATIONNR2"
            echo
            ;;
    esac
}

generate_propertiesloop()
{
# $1 = environment
# $2 = app, rep, web
# $3 = normal (always generate), check (generate if not exists)

    grep '^ *'$1"[[:blank:]]" $ABSMENUGLOBALCONFIG | sort -k2,2 -k5,5 -k4,4 | while read ABSM_ENVIRONMENT ABSM_SERVERNAME ABSM_SERVICE ABSM_TYPE ABSM_SLOT ABSM_LOCAL_HOME ABSM_REMOTE_HOME ABSM_USER ABSM_PWD ABSM_ORATNS ABSM_ORAHOME ABSM_DBSERVERNAME ABSM_DBDRIVERTYPE ABSM_DBPORTNUMBER ABSM_HEAPSPACE ABSM_STATIONNR ABSM_GFUSER ABSM_GFPASWRD ABSM_GFDOMAIN ABSM_WEBCONTEXT ABSM_WEBNAME ABSM_WEBLIB ABSM_CONNAPPSRV ABSM_CONNAPPSLOT ABSM_CONNREPSRV ABSM_CONNREPSLOT ABSM_USENATIVE ABSM_EXCLUDECUSTREP ABSM_WEB_VERSION ABSM_CLIENTDISTR_SRV ABSM_CLIENTDISTR_DIR ABSM_USER2 ABSM_PWD2 ABSM_STATIONNR2 ABSM_INET_KEY
    do
        FILTER_OK=no
        case "$ABSM_TYPE" in
            app|rep)                    		[ "$2" == "$ABSM_TYPE" ] && FILTER_OK=yes;;
            gws|w4m|wp2|wsr|wum|wcl|wua|wrd|wrr|wsb|wmr|wfb|wcp|glass) 	[ "$2" == "web" ] && FILTER_OK=yes;;
        esac
        [ "$FILTER_OK" == yes ] && create_properties "$ABSM_ENVIRONMENT" "$3" "$ABSM_TYPE" "$ABSM_SERVERNAME" "$ABSM_SLOT" "$ABSM_LOCAL_HOME" "$ABSM_USER" "$ABSM_PWD" "$ABSM_STATIONNR" "$ABSM_CONNAPPSRV" "$ABSM_CONNAPPSLOT" "$ABSM_CONNREPSRV" "$ABSM_CONNREPSLOT" "$ABSM_WEBNAME" "$ABSM_ORATNS" "$ABSM_ORAHOME" "$ABSM_USER" "$ABSM_PWD" "$ABSM_STATIONNR" "$ABSM_USENATIVE" "$ABSM_INET_KEY" "$ABSM_GFDOMAIN" "$ABSM_USER2" "$ABSM_PWD2" "$ABSM_STATIONNR2" "$ABSM_DBSERVERNAME" "$ABSM_DBDRIVERTYPE" "$ABSM_DBPORTNUMBER" 
    done
}

# $1  - app, rep, web, all
# $2  - normal (always generate), check (generate if not exists)
# $3  - environment
# ***$4...$28 only for app, rep or web
# $4  - type
# $5  - servername
# $6  - slot
# $7  - local_home
# $8  - user
# $9  - pwd
# $10 - stationnr
# $11 - connappsrv
# $12 - connappslot
# $13 - connrepsrv
# $14 - connrepslot
# $15 - webname
# $16 - oracle SID
# $17 - oracle home
# $18 - user
# $19 - password
# $20 - usenative
# $21 - inet key
# $22 - glassfish domain
# $23 - user2 (mws, garment assistant)
# $24 - pwd2 (mws, garment assistant)
# $25 - stationnr2 (mws, garment assistant)
# $26 - DBServerName (used for thin connection)
# $27 - DBDrivertype (oci8 or thin)
# $28 - DBPortnumber (standard 1521)


if [ "$1" == "web" ]
then
    do_web_config "$4" "$5" "$6" "$7" "$8" "$9" "${10}" deploy "${11}" "${12}" "${13}" "${14}" "${15}" "$3" "${22}" "${23}" "${24}" "${25}"
else
    if [ "$1" == "all" ]
    then
        generate_propertiesloop "$3" app "$2"
        generate_propertiesloop "$3" rep "$2"
        generate_propertiesloop "$3" web "$2"
    else
        [ "$1" == "app" ] && create_properties "$3" "$2" "$4" "$5" "$6" "$7" "$8" "$9" "${10}" "${11}" "${12}" "${13}" "${14}" "${15}" "${16}" "${17}" "${18}" "${19}" "${10}" "${20}" "${21}" "${22}" "${23}" "${24}" "${25}" "${26}" "${27}" "${28}"
        [ "$1" == "rep" ] && create_properties "$3" "$2" "$4" "$5" "$6" "$7" "$8" "$9" "${10}" "${11}" "${12}" "${13}" "${14}" "${15}" "${16}" "${17}" "${18}" "${19}" "${10}" "${20}" "${21}" "${22}" "${23}" "${24}" "${25}" "${26}" "${27}" "${28}"
	fi
fi
