blob: 42046ad1c294f8497d777a787bcb2abb3c376770 [file] [log] [blame]
#!/bin/sh
#--- Extract environment properties ---
for x in `cat $APS_HOME/eeconfig/ee-config.properties`
do
varval=`echo $x |cut -d'=' -f1`
if [ $varval = "admin.user" ];
then
AS_ADMIN_USER=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "admin.port" ];
then
AS_ADMIN_PORT=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "admin.host" ];
then
AS_ADMIN_HOST=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "orb.port" ];
then
ORB_LISTENER_1_PORT=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "http.port" ];
then
HTTP_LISTENER_1_PORT=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "https.port" ];
then
SSL_PORT=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "admin.password" ];
then
PASSWORD=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "master.password" ];
then
MASTERPASSWORD=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "admin.password.file" ];
then
PASSWORD_FILE=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "admin.domain" ];
then
AS_ADMIN_DOMAIN=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "nodeagent.name" ];
then
AS_ADMIN_NODEAGENT=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "appserver.instance.name" ];
then
AS_ADMIN_SERVER=`echo $x |cut -d'=' -f2`
fi
done
if [ $PASSWORD_FILE = "\${env.APS_HOME}/config/adminpassword.txt" ];
then
PASSWORD_FILE="$APS_HOME/config/adminpassword.txt"
fi
echo "password file: $PASSWORD_FILE"
export AS_ADMIN_USER
export PASSWORD
export MASTERPASSWORD
export AS_ADMIN_PORT
export AS_ADMIN_DOMAIN
export AS_ADMIN_NODEAGENT
export AS_ADMIN_SERVER
export AS_ADMIN_HOST
echo "Stopping server instance....."
${S1AS_HOME}/bin/asadmin stop-instance --host localhost --port ${AS_ADMIN_PORT} --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} ${AS_ADMIN_SERVER}
echo "Deleting server instance......"
${S1AS_HOME}/bin/asadmin delete-instance --host localhost --port ${AS_ADMIN_PORT} --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} ${AS_ADMIN_SERVER}
sleep 15
echo "stoppping nodeagent....."
${S1AS_HOME}/bin/asadmin stop-node-agent ${AS_ADMIN_NODEAGENT}
echo "Deleting nodeagent....."
${S1AS_HOME}/bin/asadmin delete-node-agent ${AS_ADMIN_NODEAGENT}
echo "Deleting nodeagent config....."
${S1AS_HOME}/bin/asadmin delete-node-agent-config --host localhost --port ${AS_ADMIN_PORT} --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} ${AS_ADMIN_NODEAGENT}
rm -rf ${S1AS_HOME}/nodeagents/${AS_ADMIN_NODEAGENT}
echo "stopping domain...."
${S1AS_HOME}/bin/asadmin stop-domain ${AS_ADMIN_DOMAIN}
${S1AS_HOME}/bin/asadmin delete-domain ${AS_ADMIN_DOMAIN}
rm -rf ${S1AS_HOME}/domains/${AS_ADMIN_DOMAIN}
echo "EE domain,server instance and nodeagent has been deleted"