标签:was
#!/bin/bash
user=`whoami`
if ps -ef | grep nodeagent | grep $user | grep java | grep -v grep >/dev/null; then
psnum=`ps -ef | grep $1 | grep $user | grep java | grep -v grep | awk ‘$1 == user && $NF == server {print $2}‘ user=$user server=$1 | wc -l`
if [ $psnum -eq 1 ] ; then
psid=`ps -ef | grep $1 | grep $user | grep java | grep -v grep | awk ‘$1 == user && $NF == server {print $2}‘ user=$user server=$1`
kill -9 $psid
elif [ $psnum -eq 0 ] ; then
case $user in
was1)
/wasprofiles/c01-`hostname`/bin/startServer.sh $1
;;
was2)
/wasprofiles/c02-`hostname`/bin/startServer.sh $1
;;
esac
fi
else
exit 0
fi
标签:was
原文地址:http://linux10000.blog.51cto.com/6338282/1954187