#!/bin/sh

# $Id: was,v 1.1 2003/11/27 00:15:09 blaine Exp $

# chkconfig: 2345 95 10
# description: WebSphere Application Server

# Works on both Solaris and Linux


# Replace <INST_OWNER> with the real UNIX user name.  For example, you
# could change "<INST_OWNER>" to "websphere".
# The double-quotes here are just so this file will pass a ksh syntax
# check before the end user makes the substitution.
INST_OWNER="<INST_OWNER>"

# This needed for \c to work in echo statements on Linux
#case "`uname`" in Linux) shopc -s xpg_echo;; esac

case "$1" in start) COMMAND=startServer.sh;;
             stop)  COMMAND=stopServer.sh;;
             restart)   su - $INST_OWNER -c "stopServer.sh server1" || exit 3
                    COMMAND=startServer.sh;;
             *) echo "SYNTAX:  was start|stop|restart" 1>&2; exit 2;;
esac
echo "WebSphere $1"
exec su - $INST_OWNER -c "$COMMAND server1"
