prevent running more than once
This commit is contained in:
parent
9394661d51
commit
25b414c69c
|
@ -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
|
||||
|
||||
|
|
|
@ -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='<id>\n')
|
||||
[[ $IPFSNODEID == "" ]] && echo "ipfs TIMEOUT" && exit 1
|
||||
|
|
Loading…
Reference in New Issue