From 18119339f8d1fab0ae150e6ce98c4bb161089f67 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Tue, 22 Aug 2017 13:23:03 +0200 Subject: [PATCH] Add shutdown to CLI --- src/bitmessagecli.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bitmessagecli.py b/src/bitmessagecli.py index 068a5597..ee877818 100644 --- a/src/bitmessagecli.py +++ b/src/bitmessagecli.py @@ -12,6 +12,7 @@ import getopt import imghdr import ntpath import json +import socket import time import sys import os @@ -1283,6 +1284,13 @@ def clientStatus(): print "\nnumberOfMessagesProcessed: " + str(clientStatus['numberOfMessagesProcessed']) + "\n" print "\nnumberOfBroadcastsProcessed: " + str(clientStatus['numberOfBroadcastsProcessed']) + "\n" +def shutdown(): + try: + api.shutdown() + except socket.error: + pass + print "\nShutdown command relayed\n" + def UI(usrInput): #Main user menu global usrPrompt @@ -1705,6 +1713,11 @@ def UI(usrInput): #Main user menu usrPrompt = 1 main() + elif usrInput == "shutdown": + shutdown() + usrPrompt = 1 + main() + elif usrInput == "million+": genMilAddr() usrPrompt = 1