Process

From LinuxSwords Wiki

Jump to: navigation, search

script to check if a process is running

That script is checking if the process named httpd is running. It's pretty selfexplanatory

#!/bin/sh
SERVICE='httpd'

if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
    echo "$SERVICE is running"
else
    echo "$SERVICE is not running"
fi
Personal tools