Skip to content

Instantly share code, notes, and snippets.

@cosmin
Created November 6, 2013 04:55
Show Gist options
  • Save cosmin/7331133 to your computer and use it in GitHub Desktop.
Save cosmin/7331133 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# wlsadmin startup script for admin server
#
# chkconfig: - 75 15
# description: WebLogic Admin Server
# processname: WLSADMIN
# Source function library
. /etc/rc.d/init.d/functions
PROG=$(basename $0)
USER=weblogic
WL_DOMAIN=mydomain
WL_SERVER=weblogic
WL_HOME=/opt/Oracle/Middleware/wlserver_10.3
start() {
echo -n $"Starting $prog: "
su - $USER -c ${WL_HOME}/user_projects/domains/${WL_DOMAIN}/bin/startWebLogic.sh > /var/log/wlsadmin.log 2>&1 &
echo OK
}
stop() {
PID=$(pgrep -f "weblogic.Name=${WL_SERVER}.*weblogic.Server")
if [ "$PID" != "" ]; then
echo -n $"Stopping $PROG: "
kill $PID
echo OK
else
/bin/echo "$PROG is already stopped"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo $"Usage: $PROG {start|stop}"
exit 1
esac
#!/bin/bash
#
# wlsndm startup script for node manager
#
# chkconfig: - 74 15
# description: WebLogic Node Manager
# processname: WLSNDM
# Source function library
. /etc/rc.d/init.d/functions
prog=$(basename $0)
USER=weblogic
WL_HOME=/opt/Oracle/Middleware/wlserver_10.3
start() {
echo -n $"Starting $prog: "
su - $USER -c ${WL_HOME}/server/bin/startNodeManager.sh > /var/log/wlsnd.log 2>&1 &
echo OK
}
stop() {
PID=$(pgrep -f weblogic.NodeManager)
if [ "$PID" != "" ]; then
echo -n $"Stopping $PROG: "
kill $PID
echo OK
else
/bin/echo "$PROG is already stopped"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo $"Usage: $PROG {start|stop}"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment