#!/bin/bash #echo "$(service httpd status)" PIDNUM=$(pgrep httpd | wc -l) if [[ $PIDNUM -eq 0 ]];then echo "Apache is stopped." read -p "Do you want to start Apache?(y/n)" START if [[ $START == y ]];then echo "$(service httpd start)" else echo "You refused to start Apache." fi else echo "Apache is running. Proccess number is $PIDNUM." if [[ $PIDNUM != 10 ]];then echo -e "/033[31mPID didn't equal 10/033[0m" fi fi