source: CMT/v1r25-branch/mgr/cmt_lockfile.sh

Last change on this file was 492, checked in by rybkin, 15 years ago

See C.L. 387

  • Property svn:executable set to *
File size: 525 bytes
Line 
1#!/bin/sh
2
3# cmt_lockfile.sh: Basic semaphore-file creator for Unix
4# Use it if the lockfile utility from http://www.procmail.org/
5# is not installed
6
7if [ "$1" = "" ]; then
8    echo "Usage: cmt_lockfile.sh file" >&2
9    exit 1
10else
11    secs=8
12    dir=`dirname $1`
13    if [ ! -d $dir ]; then
14        echo "Giving up on \"$1\"" >&2
15        exit 1
16    fi
17    if fs examine -path $dir >/dev/null 2>&1; then
18        fstype=afs
19    fi
20    while :; do
21        [ "$fstype" = afs ] && fs flush -path $dir
22        mkdir $1 2>/dev/null && break
23        sleep $secs
24    done
25fi
Note: See TracBrowser for help on using the repository browser.