+ $build_dir/module-diff $VERBOSE -w $workdir --www $WWWNAME -a &> $out_tmp
+ mv -f $out_tmp $out_file
+
+}
+
+function usage () {
+ echo "Usage: $COMMAND [-v] [-f] [-i]"
+}
+
+function main () {
+
+ while [[ -n "$@" ]] ; do
+ case "$1" in
+ -f) rm -f $LOCK ;;
+ -i) ls -l $LOCK ; exit 0 ;;
+ -v) set -x ; VERBOSE=-v ;;
+ *) usage; exit 1;;
+ esac
+ 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