cannot run multiple time simultaneously

This commit is contained in:
qo-op 2021-07-12 15:14:07 +02:00
parent e24b4ed75e
commit dba2255cd1
1 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,10 @@ YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail
[[ ! -f /home/${YOU}/.zen/secret.dunikey ]] && echo "Crypto is missing... please install 'astrXbian' TestNet" && exit 1
G1PUB=$(cat /home/${YOU}/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
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
## STOP GAMMU-SMSD
sudo service gammu-smsd stop