#!/usr/bin/env bash # The tool we use to save flash affects the startup of nginx if [ ! -d "/var/log/nginx" ]; then sudo mkdir /var/log/nginx fi # if service --status-all | grep -Fq '[ - ] nginx'; then if ! service nginx status | grep -Fq 'active (running)'; then sudo /etc/init.d/nginx start > /dev/null # systemctl start nginx fi