#!/bin/bash

#-----------------------------------------------------------
# $Id: lock.sh 138 2010-05-12 17:34:01Z rosiere $
#-----------------------------------------------------------

#-----[ lock_usage ]----------------------------------------
function lock_usage ()
{
    echo "Usage     : ${0} file";

    exit;
}

#-----[ lock ]----------------------------------------------
function lock ()
{
    if test ${#} -ne 1; then
	lock_usage ${*};
    fi;

    lockfile -1 ${1};
}

#-----[ Corps ]---------------------------------------------
lock ${*}
