#!/bin/bash run=$(ps -ef | grep apache | grep -v grep | awk '{print $8}' | head -1 | cut -d/ -f4) if [ "$run" ]; then echo "Apache esta Rodando" else apachectl start fi # [ $run ] && echo "Apache is running" || apachectl start