#!/bin/ksh

STTY=/usr/bin/stty
AWK=/usr/bin/awk
BC=/usr/bin/bc
CAT=/usr/bin/cat
CHMOD=/usr/bin/chmod
CP=/usr/bin/cp
DF=/usr/bin/df
DU=/usr/bin/du
ECHO=/usr/bin/echo
GETENT=/usr/bin/getent
GETTEXT=/usr/bin/gettext
LN=/usr/bin/ln
GREP=/usr/bin/grep
MKDIR=/usr/bin/mkdir
MV=/usr/bin/mv
PING=/usr/sbin/ping
PS=/usr/bin/ps
RM=/usr/bin/rm
SED=/usr/bin/sed
TAR=/usr/bin/tar
TOUCH=/usr/bin/touch
UNIQ=/usr/bin/uniq
WC=/usr/bin/wc

###############################################
# Get configuration from file
###############################################
GrabConfig() {
  GRABCONFIG_KEY=$1
  GRABCONFIG_FILE=$2
  GRABCONFIG_SEPARATOR=$3
  ANSWER_CONFIG=`$GREP "^$GRABCONFIG_KEY$GRABCONFIG_SEPARATOR" $GRABCONFIG_FILE | $UNIQ | $SED -e "s/$GRABCONFIG_KEY$GRABCONFIG_SEPARATOR//" | $SED -e "s/^ //"`
}

###############################################
# Get password
###############################################
GetPassword() {
  local PROMPT=$1
  local DONE=""

  DONE="n"
  while [ "$DONE" = "n" ]; do
    eval print "$PROMPT \$OMIT_CHAR"
    $STTY -echo
    read ANSWER
    $STTY echo
    print ""
    if [ "$ANSWER" != "" ]; then
      DONE="y"
    fi
  done
}

# Main
ps_props=/etc/opt/SUNWps/PSConfig.properties
gw_support_props=/etc/opt/SUNWps/SRAConfig.properties
gw_props=/etc/opt/SUNWps/GWConfig.properties
amconfig_props="/etc/opt/SUNWam/config/AMConfig.properties"

GrabConfig "IDSAME_BASEDIR" $ps_props "="
IDSAME_BASE_DIR=$ANSWER_CONFIG

GrabConfig "DEPLOY_URI" $ps_props "="
PORTAL_DEPLOY_URI=$ANSWER_CONFIG

GrabConfig "IDSAME_AMSERVER" $ps_props "="
AMSERVER_DEPLOY_URI=$ANSWER_CONFIG

GrabConfig "IDSAME_AMCONSOLE" $ps_props "="
AMCONSOLE_DEPLOY_URI=$ANSWER_CONFIG

GrabConfig "SERVER_DOMAIN" $gw_support_props "="
PORTAL_SERVER_DOMAIN=$ANSWER_CONFIG

GrabConfig "DS_HOST" $ps_props "="
DS_HOST=$ANSWER_CONFIG

GrabConfig "DS_PORT" $ps_props "="
DS_PORT=$ANSWER_CONFIG

GrabConfig "DS_DIRMGR_DN" $ps_props "="
DS_ADMIN_DN=$ANSWER_CONFIG

GrabConfig "BASEDIR" $ps_props "="
PS_BASEDIR=$ANSWER_CONFIG

GrabConfig "DEPLOY_TYPE" $ps_props "="
DEPLOY_TYPE=$ANSWER_CONFIG

GrabConfig "DEPLOY_DIR" $ps_props "="
DEPLOY_DIR=$ANSWER_CONFIG

GetPassword "What is the Directory server $DS_HOST:$DS_PORT password for $DS_ADMIN_DN ?"
DS_DIRMGR_PASSWORD=$ANSWER
export DS_DIRMGR_PASSWORD

GetPassword "What is the IS amadmin password ?"
IDSAME_ADMIN_PASSWORD=$ANSWER
export IDSAME_ADMIN_PASSWORD

AM_ADMIN_DN="amadmin"

GrabConfig "com.iplanet.am.rootsuffix" $amconfig_props "="
DS_BIND_DN=$ANSWER_CONFIG

AMADMIN=$IDSAME_BASE_DIR/SUNWam/bin/amadmin
DPADMIN=$PS_BASEDIR/SUNWps/bin/dpadmin

export LD_LIBRARY_PATH=$IDSAME_BASE_DIR/SUNWam/ldaplib/ldapsdk:/usr/lib/mps:$LD_LIBRARY_PATH

GrabConfig "SERVER_PROTOCOL" $ps_props "="
PORTAL_SERVER_PROTOCOL=$ANSWER_CONFIG

GrabConfig "SERVER_HOST" $ps_props "="
PORTAL_SERVER_HOST=$ANSWER_CONFIG

GrabConfig "SERVER_PORT" $ps_props "="
PORTAL_SERVER_PORT=$ANSWER_CONFIG

GrabConfig "com.iplanet.am.server.protocol" $amconfig_props "="
IS_SERVER_PROTOCOL=$ANSWER_CONFIG

GrabConfig "com.iplanet.am.server.host" $amconfig_props "="
IS_SERVER_HOST=$ANSWER_CONFIG

GrabConfig "com.iplanet.am.server.port" $amconfig_props "="
IS_SERVER_PORT=$ANSWER_CONFIG

LOAD_BALANCER_URL="$PORTAL_SERVER_PROTOCOL://$PORTAL_SERVER_HOST:$PORTAL_SERVER_PORT$PORTAL_DEPLOY_URI"

IS_AMSERVER_URL="$IS_SERVER_PROTOCOL://$IS_SERVER_HOST:$IS_SERVER_PORT$AMSERVER_DEPLOY_URI"
IS_AMCONSOLE_URL="$IS_SERVER_PROTOCOL://$IS_SERVER_HOST:$IS_SERVER_PORT$AMCONSOLE_DEPLOY_URI"

$ECHO "Placing Netfile .so file in library path..."
PS_LIB_DIR=$PS_BASEDIR/SUNWps/lib
if [ "$DEPLOY_TYPE" = "IWS" ]; then
    $CP $PS_LIB_DIR/libgetpwnam.so $DEPLOY_DIR/bin/https/lib
    $CP $PS_LIB_DIR/libgetpwnam2.so $DEPLOY_DIR/bin/https/lib
fi

$ECHO "Updating PropertiesViewBeanURL"
FILE="/tmp/updatePropertiesViewBeanURL.xml"
$CAT > $FILE << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Requests
  PUBLIC "-//iPlanet//Sun ONE Identity Server 6.1 Admin CLI DTD//EN"
  "jar://com/iplanet/am/admin/cli/amAdmin.dtd"
>
<Requests>
  <SchemaRootNodeRequests serviceName="srapGatewayService">
    <SetPropertiesViewBeanURL url="$LOAD_BALANCER_URL/gwadmin/GatewaySelect"/>
  </SchemaRootNodeRequests>
  <SchemaRootNodeRequests serviceName="srapNetletService">
    <SetPropertiesViewBeanURL url="$LOAD_BALANCER_URL/netletadmin/NetletAdminService"/>
  </SchemaRootNodeRequests>
  <SchemaRootNodeRequests serviceName="srapNetFileService">
    <SetPropertiesViewBeanURL url="$LOAD_BALANCER_URL/netfileadmin/NetFileTotalOne"/>
  </SchemaRootNodeRequests>
</Requests>
EOF
eval $AMADMIN -u "$AM_ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -v -t $FILE
$RM -f $FILE

$ECHO "Updating IS Administration Service..."

FILE="/tmp/removePartialDefaultValues.xml"

$CAT > $FILE << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Requests
  PUBLIC "-//iPlanet/Sun ONE Identity Server 6.0 Admin CLI DTD//EN"
  "jar://com/iplanet/am/admin/cli/amAdmin.dtd"
>
<Requests>
  <SchemaRequests serviceName="iPlanetAMAdminConsoleService" SchemaType="Global">
    <RemovePartialDefaultValues>
      <AttributeValuePair>
	<Attribute name="iplanet-am-console-service-view-bean"/>
	<Value>srapNetletService|/portal/netletadmin/NetletAdminUserProfile</Value>
      </AttributeValuePair>
    </RemovePartialDefaultValues>
  </SchemaRequests>
</Requests>
EOF
eval $AMADMIN -u "$AM_ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -v -t $FILE

$CAT > $FILE << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Requests
  PUBLIC "-//iPlanet/Sun ONE Identity Server 6.0 Admin CLI DTD//EN"
  "jar://com/iplanet/am/admin/cli/amAdmin.dtd"
>
<Requests>
  <SchemaRequests serviceName="iPlanetAMAdminConsoleService" SchemaType="Global">
    <RemovePartialDefaultValues>
      <AttributeValuePair>
	<Attribute name="iplanet-am-console-service-view-bean"/>
	<Value>srapNetFileService|/portal/netfileadmin/NetFileUserProfile</Value>
      </AttributeValuePair>
    </RemovePartialDefaultValues>
  </SchemaRequests>
</Requests>
EOF
eval $AMADMIN -u "$AM_ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -v -t $FILE

$RM -f $FILE

FILE="/tmp/addDefaultValues.xml"
$CAT > $FILE << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Requests
  PUBLIC "-//iPlanet/Sun ONE Identity Server 6.0 Admin CLI DTD//EN"
  "jar://com/iplanet/am/admin/cli/amAdmin.dtd"
>
<Requests>
  <SchemaRequests serviceName="iPlanetAMAdminConsoleService" SchemaType="Global">
    <AddDefaultValues>
      <AttributeValuePair>
	<Attribute name="iplanet-am-console-service-view-bean"/>
	<Value>srapNetletService|$PORTAL_SERVER_PROTOCOL://$PORTAL_SERVER_HOST:$PORTAL_SERVER_PORT/portal/netletadmin/NetletAdminUserProfile</Value>
      </AttributeValuePair>
      <AttributeValuePair>
	<Attribute name="iplanet-am-console-service-view-bean"/>
	<Value>srapNetFileService|$PORTAL_SERVER_PROTOCOL://$PORTAL_SERVER_HOST:$PORTAL_SERVER_PORT/portal/netfileadmin/NetFileUserProfile</Value>
      </AttributeValuePair>
    </AddDefaultValues>
  </SchemaRequests>
</Requests>
EOF
eval $AMADMIN -u "$AM_ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -v -t $FILE
$RM -f $FILE

echo "Upgrading Netlet"

FILE="/tmp/upgradeNetlet.ldif"

# Upload the corresponding ldif file.
$CAT > $FILE << EOF
#
# Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
# PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
#
dn: cn=schema
changetype:modify
add:attributeTypes
attributeTypes: ( sunPortalNetletClientBindIP-oid NAME 'sunPortalNetletClientBindIP' DESC 'SunOne Portal Netlet Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'SunOne Portal defined' )

dn: cn=schema
changetype:modify
add:objectClasses
objectClasses: ( sunPortalNetletService-oid NAME 'sunPortalNetletService' DESC 'SunOne Portal Netlet Service' SUP top AUXILIARY MAY ( sunPortalNetletRules $ sunPortalNetletPortWarn $ sunPortalNetletDoReauth $ sunPortalNetletClientLoopbackPort $ sunPortalNetletKeepAliveInterval $ sunPortalNetletAccessRules $ sunPortalNetletDenyRules $ sunPortalNetletAccessHosts $ sunPortalNetletDenyHosts $ sunPortalNetletExecute $ sunPortalNetletKSSLDefaultCipher $ sunPortalNetletJSSEDefaultCipher $ sunPortalNetletUserCipher $ sunPortalNetletPassword $ sunPortalNetletProxyType $ sunPortalNetletProxyHost $ sunPortalNetletProxyPort $ sunPortalNetletProxyOverride $ sunPortalNetletPortWarnCheckbox $ sunPortalNetletTerminateAtLogout $ sunPortalNetletClientBindIP ) X-ORIGIN 'SunOne Portal defined' )
EOF

$IDSAME_BASE_DIR/SUNWam/bin/ldapmodify -a -h $DS_HOST -p $DS_PORT -D "$DS_ADMIN_DN" -w "$DS_DIRMGR_PASSWORD" -f $FILE

$RM -f $FILE

FILE="/tmp/upgradeNetlet.xml"
FILE1="/tmp/addDynamicNetletAttributeSchema.xml"
FILE2="/tmp/addUserNetletAttributeSchema.xml"

$CAT > $FILE1 << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 2003 Sun Microsystems. Inc. All rights reserved.
Use is subject to license terms.
-->
<!DOCTYPE Requests
  PUBLIC "-//iPlanet/Sun ONE Identity Server 6.0 Admin CLI DTD//EN"
  "jar://com/sun/identity/sm/sms.dtd"
>
<Requests>
        <AttributeSchema name="sunPortalNetletClientBindIP"
            type="single"
            syntax="string"
            cosQualifier="default"
            any="display"
            i18nKey="">
            <DefaultValues>
                <Value>127.0.0.1</Value>
            </DefaultValues>
        </AttributeSchema>
</Requests>
EOF

$CAT > $FILE2 << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 2003 Sun Microsystems. Inc. All rights reserved.
Use is subject to license terms.
-->
<!DOCTYPE Requests
  PUBLIC "-//iPlanet/Sun ONE Identity Server 6.0 Admin CLI DTD//EN"
  "jar://com/sun/identity/sm/sms.dtd"
>
<Requests>
        <AttributeSchema name="sunPortalNetletClientBindIP"
            type="single"
            syntax="string"
            cosQualifier="default"
            any="display"
            i18nKey="">
        </AttributeSchema>
</Requests>
EOF

$CAT > $FILE << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 2003 Sun Microsystems. Inc. All rights reserved.
Use is subject to license terms.
-->
<!DOCTYPE Requests
  PUBLIC "-//iPlanet/Sun ONE Identity Server 6.0 Admin CLI DTD//EN"
  "jar://com/iplanet/am/admin/cli/amAdmin.dtd"
>

<Requests>
        <!-- add new values -->
        <SchemaRequests serviceName="srapNetletService"
            SchemaType="Dynamic">
            <AddAttributeSchema fileName="$FILE1"/>
        </SchemaRequests>
        <SchemaRequests serviceName="srapNetletService"
            SchemaType="User">
            <AddAttributeSchema fileName="$FILE2"/>
        </SchemaRequests>
</Requests>
EOF

eval $AMADMIN -u "$AM_ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -v -t $FILE

$RM -f $FILE $FILE1 $FILE3

echo "Done !"

echo "Upgrading Gateway"

FILE="/tmp/upgradeGateway.xml"
FILE1="/tmp/addGlobalGatewayAttributeSchema.xml"

$CAT > $FILE1 << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 2003 Sun Microsystems. Inc. All rights reserved.
Use is subject to license terms.
-->
<!DOCTYPE Requests
  PUBLIC "-//iPlanet/Sun ONE Identity Server 6.0 Admin CLI DTD//EN"
  "jar://com/sun/identity/sm/sms.dtd"
>
<Requests>
        <AttributeSchema name="sunPortalGatewayPProxyEnable"
            type="single"
            syntax="boolean"
            any="display"
            cosQualifier="default"
            i18nKey="g071">
        </AttributeSchema>
</Requests>
EOF

$CAT > $FILE << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 2003 Sun Microsystems. Inc. All rights reserved.
Use is subject to license terms.
-->
<!DOCTYPE Requests
  PUBLIC "-//iPlanet/Sun ONE Identity Server 6.0 Admin CLI DTD//EN"
  "jar://com/iplanet/am/admin/cli/amAdmin.dtd"
>

<Requests>
        <!-- add new values -->
        <SchemaRequests serviceName="srapGatewayService"
            SchemaType="Global"
            SubSchema="/Gateway-Profiles/One-Instance-Profile">
            <AddAttributeSchema fileName="$FILE1"/>
        </SchemaRequests>
</Requests>
EOF

eval $AMADMIN -u "$AM_ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -v -t $FILE

$RM -f $FILE $FILE1
echo "Done !"

echo "Updating service templates."

FILE="/tmp/updateTemplates.xml"
$CAT > $FILE << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 2003 Sun Microsystems. Inc. All rights reserved.
Use is subject to license terms.
-->
<!DOCTYPE Requests
  PUBLIC "-//iPlanet/Sun ONE Identity Server 6.0 Admin CLI DTD//EN"
  "jar://com/iplanet/am/admin/cli/amAdmin.dtd"
>

<Requests>
    <OrganizationRequests DN="$DS_BIND_DN">
        <ModifyServiceTemplate serviceName="srapNetletService"
            schemaType="Dynamic"
            level="SCOPE_SUB">
                <AttributeValuePair>
                    <Attribute name="sunPortalNetletClientBindIP" />
                    <Value>127.0.0.1</Value>
               </AttributeValuePair>
        </ModifyServiceTemplate>
    </OrganizationRequests>
</Requests>
EOF

eval $AMADMIN -u "$AM_ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -v -t $FILE

$RM -f $FILE
echo "Done !"

# Update Gateway config
echo "Updating Gateway Instances"
FILE1=/tmp/gatewayInstancesDN.ldif
FILE2=/tmp/upgradeGatewayInstances.ldif
$IDSAME_BASE_DIR/SUNWam/bin/ldapsearch -h $DS_HOST -p $DS_PORT -D "$DS_ADMIN_DN" -w "$DS_DIRMGR_PASSWORD" -b "$DS_BIND_DN" -T -1 "(&(entrydn=*,ou=Gateway-Profiles,ou=default,ou=GlobalConfig,ou=1.0,ou=srapGatewayService,ou=services,*)(sunkeyvalue=*))" dn | $GREP dn > $FILE1

$CAT > $FILE2 <<EOF
EOF

while IFS= read gatewayDN
do

$CAT >> $FILE2 << EOF
$gatewayDN
changetype:modify
delete: sunkeyvalue
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$AMSERVER_DEPLOY_URI/images

$gatewayDN
changetype:modify
delete: sunkeyvalue
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$AMSERVER_DEPLOY_URI/login_images

$gatewayDN
changetype:modify
delete: sunkeyvalue
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$AMSERVER_DEPLOY_URI/js

$gatewayDN
changetype:modify
delete: sunkeyvalue
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$AMSERVER_DEPLOY_URI/css

$gatewayDN
changetype:modify
delete: sunkeyvalue
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$AMCONSOLE_DEPLOY_URI/console/images

$gatewayDN
changetype:modify
delete: sunkeyvalue
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$AMCONSOLE_DEPLOY_URI/console/css

$gatewayDN
changetype:modify
delete: sunkeyvalue
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$AMCONSOLE_DEPLOY_URI/console/js

$gatewayDN
changetype:modify
add: sunkeyvalue
sunkeyvalue: sunPortalGatewayPProxyEnable=false
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$IS_AMSERVER_URL/images
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$IS_AMSERVER_URL/login_images
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$IS_AMSERVER_URL/js
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$IS_AMSERVER_URL/css
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$IS_AMCONSOLE_URL/console/images
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$IS_AMCONSOLE_URL/console/css
sunkeyvalue: sunPortalGatewayNonAuthenticatedURLPath=$IS_AMCONSOLE_URL/console/js

EOF

done < $FILE1

$IDSAME_BASE_DIR/SUNWam/bin/ldapmodify -a -h $DS_HOST -p $DS_PORT -D "$DS_ADMIN_DN" -w "$DS_DIRMGR_PASSWORD" -f $FILE2
$RM -f $FILE1 $FILE2
echo "Done !"

echo "Adding new services"
$PS_BASEDIR/SUNWps/lib/isconfig
echo "Done !"

/usr/bin/pkginfo -q SUNWpssp
if [ $? -eq 0 ]; then
  FILE="/etc/opt/SUNWam/config/AMConfig.properties"
  ADMIN_DN=`$GREP "^com.sun.identity.authentication.super.user=" $FILE | $SED -e "s/com.sun.identity.authentication.super.user=//"`
  ROOT_DN=`$GREP "^com.iplanet.am.rootsuffix=" $FILE | $SED -e "s/com.iplanet.am.rootsuffix=//"`
  ORG_DN=`$GREP "^com.iplanet.am.defaultOrg=" $FILE | $SED -e "s/com.iplanet.am.defaultOrg=//"`
  if [ "$ORG_DN" != "$ROOT_DN" ]; then
    ORG_DN="$ORG_DN,$ROOT_DN"
  fi

  FILE="$PS_BASEDIR/SUNWps/samples/proxylet/proxyletProvider.xml"
  $ECHO "Loading $FILE..."
  $DPADMIN add -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -g $FILE

  FILE="$PS_BASEDIR/SUNWps/samples/proxylet/proxyletChannel.xml"
  $ECHO "Loading $FILE..."
  $DPADMIN add -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" $FILE

  PROXYLET_SELECTED="$PS_BASEDIR/SUNWps/samples/proxylet/proxyletSelected.xml"
  PROXYLET_AVAILABLE="$PS_BASEDIR/SUNWps/samples/proxylet/proxyletAvailable.xml"

  $ECHO "Adding Proxylet to MyFrontPageTabPanelContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p MyFrontPageTabPanelContainer $PROXYLET_AVAILABLE
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p MyFrontPageTabPanelContainer $PROXYLET_SELECTED

  $ECHO "Adding Proxylet to JSPTabCustomTableContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p JSPTabCustomTableContainer $PROXYLET_AVAILABLE

  $ECHO "Adding Proxylet to FrameCustomTableContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p FrameCustomTableContainer $PROXYLET_AVAILABLE

  $ECHO "Adding Proxylet to MyFrontPageFramePanelContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p MyFrontPageFramePanelContainer $PROXYLET_AVAILABLE

  $ECHO "Adding Proxylet to MyFrontPageTemplatePanelContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p MyFrontPageTemplatePanelContainer $PROXYLET_AVAILABLE

  $ECHO "Adding Proxylet to TemplateTabCustomTableContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p TemplateTabCustomTableContainer $PROXYLET_AVAILABLE

  $ECHO "Adding Proxylet to ToolsTemplatePanelContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p ToolsTemplatePanelContainer $PROXYLET_AVAILABLE

  $ECHO "Adding Proxylet to PredefinedFrontPageTabPanelContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p PredefinedFrontPageTabPanelContainer $PROXYLET_AVAILABLE

  $ECHO "Adding Proxylet to PredefinedFrontPageFramePanelContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p PredefinedFrontPageFramePanelContainer $PROXYLET_AVAILABLE

  $ECHO "Adding Proxylet to PredefinedFrontPageTemplatePanelContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p PredefinedFrontPageTemplatePanelContainer $PROXYLET_AVAILABLE

  $ECHO "Adding Proxylet to PredefinedToolsTemplatePanelContainer ..."
  $DPADMIN modify -m -u "$ADMIN_DN" -w "$IDSAME_ADMIN_PASSWORD" -d "$ORG_DN" -p PredefinedToolsTemplatePanelContainer $PROXYLET_AVAILABLE
fi

exit 0
