git://git.onelab.eu
/
infrastructure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
trash lock file if older than 2h
[infrastructure.git]
/
scripts
/
all-modules.sh
diff --git
a/scripts/all-modules.sh
b/scripts/all-modules.sh
index
b33276e
..
94a0246
100755
(executable)
--- a/
scripts/all-modules.sh
+++ b/
scripts/all-modules.sh
@@
-86,6
+86,15
@@
function main () {
shift
done
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
[ -f $LOCK ] && exit 1
echo $$ > $LOCK