All pastes #577852 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-20 02:29 UTC
rendered paste body
#!/bin/sh
SERVICE='mysqld'

if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
    echo "$SERVICE service running, everything is OK"
else
    echo "$SERVICE is not running, restarting $SERVICE"
fi
SERVICE='httpd'

if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
    echo "$SERVICE service running, everything is OK"
else
    echo "$SERVICE is not running, restarting $SERVICE"
fi
SERVICE='sendmail'

if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
    echo "$SERVICE service running, everything is OK"
else
    echo "$SERVICE is not running, restarting $SERVICE"
fi