Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import os, sys, time, subprocess, threading, pygame
- def check():
- # 1800 secs = 30 mins, adjust to suit
- mythread = threading.Timer(1800.0, check)
- mythread.start()
- now = time.strftime("%c")
- print '\n' + now
- m = 'mnIPlist.txt'
- # stick your IPs in a file called mnIPlist.txt in the same directory as this script
- #eg
- #123.234.345.4
- #123.234.345.5
- #123.234.345.6
- # path to darkcoind
- p = '/home/stu/.darkcoin/darkcoind'
- with open(m, mode="r") as f:
- a = [line.strip() for line in f]
- for line in a:
- try:
- r = subprocess.check_output(p + ' masternode list | grep ' + line, shell=True)
- if r[-3] is '1':
- print 'MN ' + line + ' is OK!'
- except:
- print 'MN ' + line + ' is NOT OK!'
- pygame.mixer.init()
- pygame.mixer.music.load("my-masternode-is-b0rked.mp3")
- pygame.mixer.music.play()
- while pygame.mixer.music.get_busy() == True:
- continue
- mythread._Thread__stop()
- sys.exit()
- check()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement