#!/bin/sh
cd /home/server/boss/bin
pid=$(ps -ef | grep boss)
echo “print process pid”
echo $pid
echo “HELLO WORLD”
pidnew=$(ps -ef | grep boss | grep -v grep)
echo “print process pidnew”
echo $pidnew
echo “bew HELLO WORLD”
pidold=$(ps -ef | grep boss | grep -v grep | awk ‘{print$2}’)
echo “print process pidold”
echo $pidold
echo “old HELLO WORLD”
kill -9 ${pidold}
pidshut=$(ps -ef | grep boss | grep -v grep | awk ‘{print$2}’)
echo “print process pidshut”
echo $pidshut
echo “shut HELLO WORLD”
echo “tomcat stop success,now restart”
sh startup.sh
pidNow=$(ps -ef | grep boss | grep -v grep | awk ‘{print$2}’)
echo “print process pidnow”
echo $pidNow
echo “now HELLO WORLD”