内容如下:
#!/bin/bash
test=$(ps aux | grep httpd | grep -v grep)
if [ -n "$test" ] then echo "httpd is ok" else echo "httpd is not ok" systemctl restart httpdfi
仅在centos 7里面测试通过