#!/bin/sh
fn=`basename $0`
path_weblogic=‘/home/zhang/Oracle/Middleware/user_projects/domains/base_domain/bin‘
path_tomcat=‘/home/zhang/tomcat/bin‘
cnt=0
start()
{
echo ‘****start weblogic****‘
cd $path_weblogic
nohup ./startWebLogic.sh & > /dev/null
echo "****WebLogic is running****"
sleep 10
echo ‘****start tomcat****‘
cd $path_tomcat
./startup.sh
echo ‘****tomcat is running****‘
}
stop()
{
echo ‘****stop weblogic****‘
cd $path_weblogic
./stopWebLogic.sh
echo ‘****shutdown weblogic ok****‘
echo ‘****stop tomcat****‘
cd $path_tomcat
./shutdown.sh
echo ‘****shutdown tomcat ok****‘
}
status()
{
cnt=`ss -lnp|grep -E "7001|8080"|wc -l`
if [ $cnt -eq 0 ];then
echo ‘****weblogic tomcat server is invaliad****‘
else
{
echo ‘****weblogic tomcat server is valiad****‘
ss -lnp|grep -E "7001|8080"
}
fi
}
other()
{
echo " usage:$fn {start|stop|status}"
exit 2
}
case $1 in
start)
start
;;
stop)
stop
;;
status)
status
;;
*)
other
;;
esac
exit 0
本文出自 “weiweiyong” 博客,请务必保留此出处http://weiweiyong.blog.51cto.com/8142509/1979348
原文地址:http://weiweiyong.blog.51cto.com/8142509/1979348