shift
done
+ # is the stamp older than 2 hours ?
+ # in minutes
+ GRACE=120
+ is_old=$(find $LOCK -mmin +$GRACE 2> /dev/null)
+ if [ -n "$is_old" ] ; then
+ echo "$LOCK is older than $GRACE minutes - removing"
+ rm -f $LOCK
+ fi
+
[ -f $LOCK ] && exit 1
echo $$ > $LOCK