This commit is contained in:
poka 2020-11-10 23:50:49 +01:00
parent 080ff36af4
commit 96f983db1d
1 changed files with 5 additions and 5 deletions

View File

@ -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