注:有问题或更好可以一起探讨谢谢 #!/bin/bash nginx=/usr/local/nginx/sbin/nginx echo nginx一键启动,停止,查看..... read -ep 请输入你的操作,1.stop,2.start,3.reload,4.status(1,2,3,4): nginx1 case $nginx1 in 1) netstat -nlpt | grep nginx > /dev/null if [ $? -eq 0 ];then pkill -15 nginx echo nginx成功停止... else