Saturday, February 18, 2012

Nice script to start WebLogic Admin Server

#!/bin/sh

#declare variables
DOMAIN_HOME=/opt/oracle/domains/mydomain
SERVER_NAME=myAdminServer

#verify if Domain Directory exists

if [ ! -d $DOMAIN_HOME ] ; then
echo Domain directory $DOMAIN_HOME does not exist!
exit 1
fi

#start admin in nohup, redirect stdout and stderro
nohup ${DOMAIN_HOME}/startWebLogic.sh > /var/log/weblogic/server/${SERVER_NAME}.out 2>&1 &

#make sure that AdminServer has actually started

servers=`jps -v | grep Server | grep $SERVER_NAME | wc -l`
if [ "servers" == "0" ] ; then
echo Server is not started
exit 1
fi

#show all running weblogic servers
jps | grep Server

No comments: