#!/bin/bash
#"if...else" usage
#FileName test.apache
#Using this program to show your system's services.
echo "Now,the web services of this Linux system will be detect..."
echo 
#Detect www service 
web=`/usr/bin/pgrep httpd`
if [    "$web" != ""    ]
then
        echo "The web service is running."
else
        echo "The web service is NOT running."
        /etc/rc.d/init.d/httpd start
fi