source: trunk/IPs/systemC/processor/Morpheo/Script/lock.sh @ 85

Last change on this file since 85 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
Line 
1#!/bin/bash
2
3#-----------------------------------------------------------
4# $Id: lock.sh 85 2008-05-14 13:09:48Z rosiere $
5#-----------------------------------------------------------
6
7#-----[ usage ]---------------------------------------------
8function usage ()
9{
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
16    exit;
17}
18
19#-----[ lock ]----------------------------------------------
20function lock ()
21{
22    lockfile -1 ${1};
23}
24
25#-----[ main ]----------------------------------------------
26function main ()
27{
28    LOCK_DIRECTORY="${MORPHEO_HOME}/lock";
29
30    if test ${#} -ne 1 -o -z ${MORPHEO_HOME} -o ! -d ${LOCK_DIRECTORY}; then
31        usage ${*};
32    fi;
33
34    lock "${LOCK_DIRECTORY}/$(basename ${1}).lock"
35}
36
37#-----[ Corps ]---------------------------------------------
38main ${*}
Note: See TracBrowser for help on using the repository browser.