Last change
on this file since 129 was
85,
checked in by rosiere, 16 years ago
|
- Ifetch_unit : systemC test ok
- modif shell script and makefile.tools : SHELL=/bin/bash
|
-
Property svn:keywords set to
Id
|
File size:
925 bytes
|
Rev | Line | |
---|
[85] | 1 | #!/bin/bash |
---|
| 2 | |
---|
[82] | 3 | #----------------------------------------------------------- |
---|
| 4 | # $Id: lock.sh 85 2008-05-14 13:09:48Z rosiere $ |
---|
| 5 | #----------------------------------------------------------- |
---|
[2] | 6 | |
---|
| 7 | #-----[ usage ]--------------------------------------------- |
---|
| 8 | function usage () |
---|
| 9 | { |
---|
[78] | 10 | echo "Usage : ${0} file"; |
---|
| 11 | echo "Arguments : "; |
---|
| 12 | echo ' * file : you can see the lock at "${MORPHEO_HOME}/lock/$(basename file).lock"'; |
---|
| 13 | echo "Notes :"; |
---|
| 14 | echo " * Morpheo's environnement must be positionned."; |
---|
| 15 | |
---|
[2] | 16 | exit; |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | #-----[ lock ]---------------------------------------------- |
---|
| 20 | function lock () |
---|
| 21 | { |
---|
| 22 | lockfile -1 ${1}; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | #-----[ main ]---------------------------------------------- |
---|
| 26 | function main () |
---|
| 27 | { |
---|
[78] | 28 | LOCK_DIRECTORY="${MORPHEO_HOME}/lock"; |
---|
| 29 | |
---|
| 30 | if test ${#} -ne 1 -o -z ${MORPHEO_HOME} -o ! -d ${LOCK_DIRECTORY}; then |
---|
[2] | 31 | usage ${*}; |
---|
| 32 | fi; |
---|
| 33 | |
---|
[78] | 34 | lock "${LOCK_DIRECTORY}/$(basename ${1}).lock" |
---|
[2] | 35 | } |
---|
| 36 | |
---|
| 37 | #-----[ Corps ]--------------------------------------------- |
---|
| 38 | main ${*} |
---|
Note: See
TracBrowser
for help on using the repository browser.