summaryrefslogtreecommitdiff
path: root/functions/lockfile.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:04:49 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:18:29 +0100
commitda353a5231ad925013d01065768864307c70651a (patch)
tree589606906e4e8966797f352ec63162cbb4016da0 /functions/lockfile.sh
parent068a51b175546dfeac45c747236817cb41db50d7 (diff)
downloadvyos-live-build-da353a5231ad925013d01065768864307c70651a.tar.gz
vyos-live-build-da353a5231ad925013d01065768864307c70651a.zip
Adding live-helper 1.0~a4-1.
Diffstat (limited to 'functions/lockfile.sh')
-rwxr-xr-xfunctions/lockfile.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/functions/lockfile.sh b/functions/lockfile.sh
index ee01889be..3b44e544c 100755
--- a/functions/lockfile.sh
+++ b/functions/lockfile.sh
@@ -11,30 +11,30 @@ set -e
Check_lockfile ()
{
- LOCKFILE="${1}"
+ FILE="${1}"
# Checking lock file
- if [ -f "${LOCKFILE}" ]
+ if [ -f "${FILE}" ]
then
- echo "E: system locked"
+ Echo_error "system locked"
exit 1
fi
}
Create_lockfile ()
{
- LOCKFILE="${1}"
- LOCKDIRECTORY="`dirname ${1}`"
+ FILE="${1}"
+ DIRECTORY="`dirname ${1}`"
# Creating lock directory
- if [ ! -d "${LOCKDIRECTORY}" ]
+ if [ ! -d "${DIRECTORY}" ]
then
- mkdir -p "${LOCKDIRECTORY}"
+ mkdir -p "${DIRECTORY}"
fi
# Creating lock trap
- trap "test -f ${LOCKFILE} && rm -f ${LOCKFILE}; exit 0" 0 2 15
+ trap "test -f ${FILE} && rm -f ${FILE}; exit 0" 0 2 15
# Creating lock file
- touch "${LOCKFILE}"
+ touch "${FILE}"
}