Created
February 1, 2018 21:20
-
-
Save lukestokes/4e0348ae4bde2e0b518951899f51f831 to your computer and use it in GitHub Desktop.
Make sure each smart node is running. If it's not, restart it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# makerun.sh | |
# Make sure the daemon is not stuck. | |
# Add the following to the crontab (i.e. crontab -e) | |
# */2 * * * * ~/smartcash/makerun.sh | |
PREFIX="0" | |
START_NUMBER=$(<~/smartcash/start_number.txt) | |
END_NUMBER=$(<~/smartcash/end_number.txt) | |
for (( number=$START_NUMBER; number<=$END_NUMBER; number++ )) | |
do | |
if [ $number -gt 9 ] | |
then | |
PREFIX="" | |
fi | |
NODE=$PREFIX$number | |
if ps aux | grep smartcashd | grep SmartNode$NODE > /dev/null | |
then | |
echo "SmartNode$NODE is running..." | |
else | |
~/smartcash/smart-start.sh $NODE | |
fi | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment