Lines 37-43
Link Here
|
37 |
|
37 |
|
38 |
# Make sure we're not running multiple instances at once. |
38 |
# Make sure we're not running multiple instances at once. |
39 |
# Try twice to lock, otherwise give up. |
39 |
# Try twice to lock, otherwise give up. |
40 |
for ((i = 0; i < 2; i = i + 1)); do |
40 |
i=0 |
|
|
41 |
while [ "$i" -lt 2 ]; do |
41 |
ln -sn $$ ${LOCKFILE} 2>/dev/null && break |
42 |
ln -sn $$ ${LOCKFILE} 2>/dev/null && break |
42 |
|
43 |
|
43 |
# lock failed, check for a running process. |
44 |
# lock failed, check for a running process. |
Lines 54-59
Link Here
|
54 |
else |
55 |
else |
55 |
rm -f ${LOCKFILE} |
56 |
rm -f ${LOCKFILE} |
56 |
fi |
57 |
fi |
|
|
58 |
i=$(($i+1)) |
57 |
done |
59 |
done |
58 |
|
60 |
|
59 |
# Check to make sure locking was successful |
61 |
# Check to make sure locking was successful |