Skip to content

Commit

Permalink
refactor: 💡 move /health check to inner log verification given stakin…
Browse files Browse the repository at this point in the history
…g error etc
  • Loading branch information
heldrida committed Oct 18, 2023
1 parent 11c466b commit 2cd70e3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions scripts/healthcheck
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,6 @@ warningCount=0
echo "🐛 Found some possible issues in the $defaultLightningConfigPath"
fi

if ! curl -s -w "\p" localhost:4230/health | grep -iq 'OK'; then
echo "⚠️ WARNING: Failed to get a response from localhost:4230/health. The node is not running, if you are participating in testnet, then read the instructions in https://docs.fleek.network/docs/node/testnet-onboarding, to run successfully!"

((warningCount++))
((healthIssueCount++))
else
echo "✅ The localhost:4230/health is okay"
fi

if [[ -f "$defaultLightningSystemdServicePath" ]]; then
while read -rp "🤖 This process requires to clear the logs and restart the service. Should it clear the logs and restart the service? (yes/no) " answer; do
if [[ "$answer" == [nN] || "$answer" == [nN][oO] ]]; then
Expand Down Expand Up @@ -188,6 +179,17 @@ warningCount=0

break;
fi

if ! curl -s -w "\p" localhost:4230/health | grep -iq 'OK'; then
echo "⚠️ WARNING: Failed to get a response from localhost:4230/health. The node is not running, if you are participating in testnet, then read the instructions in https://docs.fleek.network/docs/node/testnet-onboarding, to run successfully!"

((warningCount++))
((healthIssueCount++))
else
echo "✅ The localhost:4230/health is okay"

break;
fi
fi

printf "💩 Uh-oh! We expect a yes or no answer. Try again...\n"
Expand Down

0 comments on commit 2cd70e3

Please sign in to comment.