Bootstrap

用shell脚本查看NGINX的状态并开启

#! /bin/bash
nginx(){
        systemctl status nginx
        #if [ `systemctl status nginx | grep 'running'` -eq "running" ];then
        for i in `systemctl status nginx`
        do
                if [ $i == "active" ];then
                echo "nginx is running"
                fi
                if [ $i == "inactive" ];then
                echo "nginx is dead"
                systemctl start nginx
                fi

        done
}
nginx

;