#!/usr/bin/ksh # Should work with any other shell too if [ ! ps -aux | grep "/home/corion/myservice.pl" ]; then echo "(Re)starting myservice"; exec /home/corion/myservice.pl >/dev/null fi