diff --git a/peer-count-auto-restart.sh b/peer-count-auto-restart.sh index 970cce3..8891e7f 100755 --- a/peer-count-auto-restart.sh +++ b/peer-count-auto-restart.sh @@ -64,7 +64,7 @@ main_loop() { if [ -z "$number_of_connections" ]; then log "Failed to retrieve number of connections." - elif [[ "$NUMBER_OF_CONNECTIONS" =~ ^[0-9]+$ ]] && [ "$NUMBER_OF_CONNECTIONS" -lt "$ACCEPTABLE_PEERS" ]; then + elif [[ "$number_of_connections" =~ ^[0-9]+$ ]] && [ "$number_of_connections" -lt "$ACCEPTABLE_PEERS" ]; then log "Number of connections ($number_of_connections) is below acceptable threshold ($ACCEPTABLE_PEERS). Restarting Qortal..." restart_qortal else @@ -72,6 +72,7 @@ main_loop() { log "Set peer count: $ACCEPTABLE_PEERS" fi + sleep 300 # Wait for 5 minutes before next check done }