browser icon
You are using an insecure version of your web browser. Please update your browser!
Using an outdated browser makes your computer unsafe. For a safer, faster, more enjoyable user experience, please update your browser today or try a newer browser.

Script to check whether IPNetSentryX process is running on Macintosh OS X

Posted by on March 12, 2009

I recently installed IPNetSentryX on our Macintosh OS X 10.4.11 webserver in order to filter out abusive IPs. In order to make sure this firewall is running all the time, here’s a script I’m calling every minute via cron:

# check daemon
ps ax | grep -v grep | grep IPNetSentryX
# if not found – equals to 1, start it
if [ $? -eq 1 ]
then
/Library/StartupItems/IPNetSentryX_startup/IPNetSentryX_startup
else
echo “eq 0 – IPNetSentryX found – do nothing”
fi

I modified the script from this page:

http://cazatech.wordpress.com/2007/07/07/shell-script-restart-process-if-not-found-running/