From 64d208039f9c30793a57c93a079f1acca2d2abba Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 6 Aug 2021 00:25:58 +0200 Subject: [PATCH] better like that --- cron_MINUTE.sh | 1 + zen/tools/autoPINfriends.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 4e86a4b..a4c728f 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -78,6 +78,7 @@ weeknumber=$(date +%V) # WAKEUP TIME if [[ ! -f /home/$YOU/.zen/A_Station_ON ]]; then echo "onheure=$heure; onminute=$minute; ontimebar=$timebar" > /home/$YOU/.zen/A_Station_ON + [[ -f -f /tmp/A_Station_ON ]] && cp /tmp/A_Station_ON /home/$YOU/.zen/A_Station_ON else source /home/$YOU/.zen/A_Station_ON old=$ontimebar diff --git a/zen/tools/autoPINfriends.sh b/zen/tools/autoPINfriends.sh index e0e8767..185590f 100755 --- a/zen/tools/autoPINfriends.sh +++ b/zen/tools/autoPINfriends.sh @@ -7,6 +7,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 + YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); IPFSNODEID=$(ipfs id -f='\n') G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)