From 96f983db1d77b76facaed8eb946af159415a0645 Mon Sep 17 00:00:00 2001 From: poka Date: Tue, 10 Nov 2020 23:50:49 +0100 Subject: [PATCH] old fix --- duniter-checkBlock.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/duniter-checkBlock.sh b/duniter-checkBlock.sh index 95612c0..b1b8b70 100755 --- a/duniter-checkBlock.sh +++ b/duniter-checkBlock.sh @@ -1,6 +1,6 @@ #!/bin/bash -refname="https://g1.cgeek.fr" +refName="https://g1.cgeek.fr" date=$(date '+%d-%m-%y à %H:%M') echo "############################" @@ -14,16 +14,16 @@ lockSync="/home/poka/scripts/lock-sync" PID=$(ps auxf | grep "duniter" | grep -v -E "color=auto|grep|restart" | awk '{ print $2 }') PID=($(echo "$PID" | tr '\n' ' ')) -if [[ -z $PID ]]; then +pokaNode=$(curl -s http://192.168.9.54:45000/blockchain/current | jq '.number') +refNode=$(curl -s $refName/blockchain/current | jq '.number') + +if [[ -z $PID || -z $pokaNode ]]; then $rep/duniter-restart.sh actionAlerte="redémarré" sendalerte exit 0 fi -pokaNode=$(curl -s http://192.168.9.54:45000/blockchain/current | jq '.number') -refNode=$(curl -s $refname/blockchain/current | jq '.number') - [[ -e $lockSync ]] && lock=$(cat $lockSync) if [[ -z $pokaNode ]]; then if [[ $lock > 3 ]]; then