测试web服务器是否停止

#!/bin/bash
#"if...else" usage
#FileName test.apache
#Using this program to show your system's services.
echo "Now,the web services of this Linux system will be detect..."
echo
#Detect www service
web=`/usr/bin/pgrep httpd`
if [    "$web" != ""    ]
then
        echo "The web service is running."
else
        echo "The web service is NOT running."
        /etc/rc.d/init.d/httpd start
fi

分割线
感谢打赏
江西数库信息技术有限公司
YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS