From 82bd9596b89c61008aad0c0a59d52b864d90ca9e Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 8 Apr 2022 23:29:28 +0200 Subject: [PATCH] countMErunning --- crowdbunker.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crowdbunker.sh b/crowdbunker.sh index c06801d..b8002c4 100755 --- a/crowdbunker.sh +++ b/crowdbunker.sh @@ -13,6 +13,9 @@ mkdir -p ~/.zen/bunkerbox # BunkerBOX temp directory MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" +countMErunning=$(ps auxf --sort=+utime | grep -w "$ME" | grep -v -E 'color=auto|grep' | wc -l) +[[ $countMErunning -gt 2 ]] && echo "$ME already running. EXIT." && exit 0 + TS=$(date -u +%s%N | cut -b1-13) [[ ! $(which ipfs) ]] && echo "EXIT. Vous devez avoir installé ipfs CLI sur votre ordinateur" && echo "RDV sur https://dist.ipfs.io/#go-ipfs" && exit 1