From 25b414c69ca7b8e85a99e46efdc502b67fcb6c35 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 5 Aug 2021 23:47:37 +0200 Subject: [PATCH] prevent running more than once --- zen/gchange_INIT.sh | 1 - zen/ipns_self_publish.sh | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index 1db638d..02ba7b1 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -7,7 +7,6 @@ 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 $countMErunning time" && exit 0 diff --git a/zen/ipns_self_publish.sh b/zen/ipns_self_publish.sh index 5100cf8..e4bdf58 100755 --- a/zen/ipns_self_publish.sh +++ b/zen/ipns_self_publish.sh @@ -3,6 +3,9 @@ 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 $countMErunning time" && exit 0 + ######################################################################## IPFSNODEID=$(ipfs --timeout=30s id -f='\n') [[ $IPFSNODEID == "" ]] && echo "ipfs TIMEOUT" && exit 1