首页 > 系统服务 > 详细

初学Linux之简单的Shell

时间:2016-09-12 14:04:41      阅读:209      评论:0      收藏:0      [点我收藏+]

先占坑,回头补充完善哈

 

#!/bin/bash
# Program:
# This program is used to stop tomcat.
# History:
# 2016/09/11 XH First release
pid=`ps -ef|grep tomcat|grep -v grep|awk ‘{print $2}‘`
if [ $pid ]
then
        echo ‘Tomcat is already running..‘
else

        /opt/tomcat7/bin/startup.sh
        echo ‘Tomcat has just been started..‘
        tail -f /opt/tomcat7/logs/catalina.out
fi

 

pid=`ps -ef|grep tomcat|grep -v grep|awk ‘{print $2}‘`
if [ $pid ]
then
        echo ‘Tomcat is alread running..pid is --> $pid‘
else
        echo ‘Tomcat has just been started..‘
fi

初学Linux之简单的Shell

原文:http://www.cnblogs.com/hywht/p/5864349.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!