From 5fc24e9c74b175856779eafb42fbf1c09aa160ca Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 4 Jan 2012 12:59:16 +0100 Subject: [PATCH] do not allow more than one working copy --- ezsync | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ezsync b/ezsync index aa5fae1..dc6c998 100755 --- a/ezsync +++ b/ezsync @@ -15,6 +15,14 @@ source ${EZROOT}/libraries/common loadLibraries loadConfiguration +# Do not allow more than one working copy +PID=$(pidof -s -o '%PPID' -x ${EZNAME}) +if [ ${PID} ]; then + printWarn "The ${EZNAME} is already working with PID: ${PID}" + printWarn "You cannot have more than one instancies running" + exit 0 +fi + # Print EzBuild notice and parse arguments printNotice until [[ -z "${1}" ]]; do