Post
Topic
Board Announcements (Altcoins)
Re: ✅|ANN| 🌍DESIRE |NeoScrypt| |🔨CPU GPU MINING🔨| - COIN OF YOUR DREAMS!
by
mining_drone_143
on 15/11/2017, 23:04:12 UTC
I wrote this small script for getting a mail-alert if my node stops being ENABLED. This is probably trivial for most of you guys, but I though I´d share if it could help anyone:
This only works on a linux server!

If you are not sure if your VPS has mail setup properly try running:
Code:
echo "Test" |  mailx -s "Test"
Wait and see if you get any mail. I will not document setting up mail since I did not need to do it :-)

Add this to a file called desire-alert.sh and fill out all the placeholders marked with <>
Code:
#!/bin/bash

#This is the transaction containing your 1000 DSR, the result from getnewaddress MN1
tx="0-"

#Look for your node in the masternode list, identified by the transaction
status=$(/home//Desire/src/desire-cli masternode list | grep "$tx");

#Make sure it has the correct status, if not send a mail
if [[ "$status" != *"\"$tx\": \"ENABLED\""* ]]; then
 echo "Current status: $status" |  mailx -s "Desire masternode is down"
fi

run
Code:
chmod o+x desire-alert.sh

Run command:
Code:
crontab -e
And add row:
Code:
*/5 * * * * /desire-alert.sh

The script will now run every 5 min