#!/bin/ksh ################################################# # was - start/stop the WebSphere servers # J. David Schronce # # added support for landmark # M McGee 8/1/07 ################################################# WAS_HOME=/lwsnt/IBM/WebSphere/AppServer LAWSERVER1=lwsnt_server01 LAWSERVER2=lwsnt_server02 LMKSERVER=lmrkt_server01 USAGE="Start, Stop or Restart any of the WebSphere Application Services\n$0 start|stop|restart d|l|n|s|all" if [ $# -lt 2 ]; then echo $USAGE; exit fi option=$1 module=$2 if [[ $LOGNAME != "root" ]]; then echo "Only executable by 'root'" exit fi #Functions startd () { cd $WAS_HOME/profiles/Dmgr01/bin echo "\n`tput smso`Starting Deployment Manager`tput rmso`\n" ./startManager.sh } startn () { cd $WAS_HOME/profiles/lwsnt_profile/bin echo "\n`tput smso`Starting Node Manager`tput rmso`\n" ./startNode.sh } starts () { cd $WAS_HOME/profiles/lwsnt_profile/bin echo "\n`tput smso`Starting Server`tput rmso`\n" ./startServer.sh $LAWSERVER1 ./startServer.sh $LAWSERVER2 } startl () { cd $WAS_HOME/profiles/lmrkt_profile/bin echo "\n`tput smso`Starting Server`tput rmso`\n" ./startServer.sh $LMKSERVER } stopd () { cd $WAS_HOME/profiles/Dmgr01/bin echo "\n`tput smso`Stopping Deployment Manager`tput rmso`\n" ./stopManager.sh } stopn () { cd $WAS_HOME/profiles/lwsnt_profile/bin echo "\n`tput smso`Stopping Node Manager`tput rmso`\n" ./stopNode.sh } stops () { cd $WAS_HOME/profiles/lwsnt_profile/bin echo "\n`tput smso`Stopping Server`tput rmso`\n" ./stopServer.sh $LAWSERVER1 ./stopServer.sh $LAWSERVER2 } stopl () { cd $WAS_HOME/profiles/lmrkt_profile/bin echo "\n`tput smso`Stopping Server`tput rmso`\n" ./stopServer.sh $LMKSERVER } case $option in start) case $module in d) startd;; l) startl;; n) startn;; s) starts;; all) startd; startl; startn; starts;; esac;; stop) case $module in d) stopd;; l) stopl;; n) stopn;; s) stops;; all) stops; stopl; stopn; stopd;; esac;; restart) case $module in d) stopd; startd;; l) stopl; startl;; n) stopn; startn;; s) stops; starts;; all) stops; stopl; stopn; stopd; startd; startl; startn; starts;; esac;; esac exit