countMErunning

This commit is contained in:
fred 2022-04-08 23:29:28 +02:00
parent 6a0f370f24
commit 82bd9596b8
1 changed files with 3 additions and 0 deletions

View File

@ -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