Add shutdown to CLI

This commit is contained in:
Peter Šurda 2017-08-22 13:23:03 +02:00
parent b7f808cde1
commit 18119339f8
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -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