X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fall-modules.sh;h=94a0246d8df9a220db86b3d4a1d1e0a5d20a25c9;hb=81896bcf80425cf33789528885e3ff90cc53de54;hp=b33276e965c8855bba5d319ba84aa5ea6eb2ca8c;hpb=e1638bde45a6ed2b4a42b4243c2e57e9fa67154c;p=infrastructure.git diff --git a/scripts/all-modules.sh b/scripts/all-modules.sh index b33276e..94a0246 100755 --- a/scripts/all-modules.sh +++ b/scripts/all-modules.sh @@ -86,6 +86,15 @@ function main () { 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