DrkMiner
Active member
To insure your MN is up all times or auto start after reboot, I wrote a small script that checks every 2 minutes if the Node is up and restart it if not.
Recently Digitaloncean been doing some upgrades and Nodes were rebooted.
Check if the service darkcoind is running and if not start it
Recently Digitaloncean been doing some upgrades and Nodes were rebooted.
Check if the service darkcoind is running and if not start it
1. Create a mn_autostart.sh file with this code:
2. Upload to same directory as your ./darkcoind
3. Chomd file to 744
Run the script every 2 minutes - crontab
Code:
#!/bin/sh
SERVICE='darkcoind'
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "$SERVICE is already running!"
else
./darkcoind
fi
3. Chomd file to 744
1. On your SSH screen type:
export EDITOR=nano
crontab -e
2. Paste the code at the end
3. Save and exit
4. Make sure you have the correct path to the script. If you login as a user you will have to change the dir from "root" to that user.
export EDITOR=nano
crontab -e
2. Paste the code at the end
Code:
*/2 * * * * sh /root/mn_autostart.sh >/dev/null 2>&1
4. Make sure you have the correct path to the script. If you login as a user you will have to change the dir from "root" to that user.