Tuesday, April 21, 2009

Simple cron script to watch a firefox kiosk

Put this in your crontab -e:

* * * * * /user/cron.sh

then in /user/cron.sh put

#!/usr/bin/bash
TEST=`ps ax | grep firefox | grep -v grep | grep -v /usr/bin/firefox | wc -l`
if [ $TEST = 0 ] ; then
/usr/bin/firefox &
fi


and make sure it is set to chmod 755 /user/cron.sh

No comments:

Post a Comment