Skip to content

Commit

Permalink
Add cron/daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkay committed Oct 9, 2011
1 parent 0915072 commit bf102d4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cron/daemon
@@ -0,0 +1,18 @@
#!/bin/sh

# This script monitors other daemons and restarts them if they are dead.
# Add it to the crontab on @reboot.

trap 'kill $MB_PID; exit' HUP INT TERM

MB_PID=

while :
do
if [ -z "$MB_PID" ] || ! kill -0 $MB_PID > /dev/null 2>&1 ; then
./musicbrainz.py &
MB_PID="$!"
fi

sleep 10
done

0 comments on commit bf102d4

Please sign in to comment.