#!/bin/sh
pid=`/sbin/pidof java`
echo "/sbin/pidof java "$pid
sleep 2
if [ -n "$pid" ];
then
{
echo "==========tomcat is start ,now kill $pid============"
kill -9 $pid
echo "==kill -9 $pid==="
sleep 1
export JAVA_HOME=/usr/java/jdk1.6.0_19
export CATALINA_HOME=/usr/local/tomcat
cd /usr/local/tomcat/bin
'./startup.sh'
}
else
{
echo "==========tomcat is stop=====start======="
export JAVA_HOME=/usr/java/jdk1.6.0_19
export CATALINA_HOME=/usr/local/tomcat
cd /usr/local/tomcat/bin
'./startup.sh'
}
fi
sleep 25
echo "dbstar"
pid=`/sbin/pidof java`
echo "/sbin/pidof java "$pid
sleep 2
if [ -n "$pid" ];
then
{
echo "==========tomcat is start ,now kill $pid============"
kill -9 $pid
echo "==kill -9 $pid==="
sleep 1
export JAVA_HOME=/usr/java/jdk1.6.0_19
export CATALINA_HOME=/usr/local/tomcat
cd /usr/local/tomcat/bin
'./startup.sh'
}
else
{
echo "==========tomcat is stop=====start======="
export JAVA_HOME=/usr/java/jdk1.6.0_19
export CATALINA_HOME=/usr/local/tomcat
cd /usr/local/tomcat/bin
'./startup.sh'
}
fi
sleep 25
echo "dbstar"
转载于:https://blog.51cto.com/daheyuan/1141813