lbry-sdk/lbrynet/lbrynet_daemon/LBRYDaemonStopper.py
Jack 1e73b2437d Update daemon and uri handler
Add command to stop daemon from the terminal

If lbrynet-daemon isn’t running the uri handler will now redirect to
lbry.io/get
2016-01-22 09:44:38 -05:00

21 lines
411 B
Python

import xmlrpclib
def main():
daemon = xmlrpclib.ServerProxy("http://localhost:7080/")
try:
b = daemon.get_balance()
is_running = True
except:
is_running = False
if is_running:
try:
daemon.stop()
except:
print "LBRYnet daemon stopped"
else:
print "LBRYnet daemon wasn't running"
if __name__ == '__main__':
main()