写一个脚本判断你的 Linux 服务器里是否开启 web 服务,如果开启了,请判断出跑的是什么服务,是 httpd 呢还是 nginx 又或者是其他的什么服务
#!/bin/bashport=`netstat -lnp | grep 80`if [ -z "port" ]; then ???echo "no start services." ???exitfiweb_service=`echo $port | awk -F ‘/‘ ‘{print $2}‘`case $web_service in ???httpd) ???????echo "httpd service" ???????;; ???nginx) ???????echo "nginx service" ???????;; ???*) ???????echo "other service"esac
判断是否开启 Web 服务
原文地址:http://www.cnblogs.com/pzk7788/p/7428938.html