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/