重啓tomcat之shell腳本

#!/bin/bash
pid=`lsof -i:8080 |sed -n 2p  | awk '{print $2}'`

echo $pid

if [ "-$pid" = "-"  ];then
	echo "start to restart tomcat at port 8080"
	su -  huawei -c 'sh /home/huawei/tomcat/bin/startup.sh'  
#	cd /home/huawei/tomcat/bin
	#sh startup.sh

fi

 

發佈了295 篇原創文章 · 獲贊 4 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章