#!/bin/bash
#export JAVA_HOME="/usr/lib/jvm/jdk1.7.0_07"
startcmd='/opt/WSO2/wso2is-5.3.0/bin/wso2server.sh start > /dev/null &'
restartcmd='/opt/WSO2/wso2is-5.3.0/bin/wso2server.sh restart > /dev/null &'
stopcmd='/opt/WSO2/wso2is-5.3.0/bin/wso2server.sh stop > /dev/null &'
case "$1" in
start)
echo "Starting WSO2 Application Server ..."
su -c "${startcmd}" wso2server
;;
restart)
echo "Re-starting WSO2 Application Server ..."
su -c "${restartcmd}" wso2server
;;
stop)
echo "Stopping WSO2 Application Server ..."
su -c "${stopcmd}" wso2server
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac