X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=bin%2Firspy-update.sh;h=a29d16757a4a5139cdecbd2cbc97b69b2c8f69a1;hp=90d52594f44fbfcc234e4ed6ffdf690a375aec7e;hb=328dfd27622bdf5d73a0748da8351e2ab21833fe;hpb=60ac227b4a81f6d5f5b60bce0dc6321a9008e82f diff --git a/bin/irspy-update.sh b/bin/irspy-update.sh index 90d5259..a29d167 100755 --- a/bin/irspy-update.sh +++ b/bin/irspy-update.sh @@ -8,6 +8,16 @@ home=/usr/local/src/git cd $home/irspy/bin || exit 2 logdir=../tmp +lockfile=../tmp/irspy-update.lock + +if [ -f $lockfile ]; then + pid=`cat $lockfile` + if kill -0 $pid 2>/dev/null; then + echo "This script is already running with pid: $pid" + exit 1 + fi +fi +echo $$ > $lockfile || exit 2 for i in 0 1 2 3 4 5 6 do @@ -16,3 +26,5 @@ do gzip -f $logfile done +rm -f $lockfile +