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 untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -12,6 +12,7 @@ import getopt
import imghdr import imghdr
import ntpath import ntpath
import json import json
import socket
import time import time
import sys import sys
import os import os
@ -1283,6 +1284,13 @@ def clientStatus():
print "\nnumberOfMessagesProcessed: " + str(clientStatus['numberOfMessagesProcessed']) + "\n" print "\nnumberOfMessagesProcessed: " + str(clientStatus['numberOfMessagesProcessed']) + "\n"
print "\nnumberOfBroadcastsProcessed: " + str(clientStatus['numberOfBroadcastsProcessed']) + "\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 def UI(usrInput): #Main user menu
global usrPrompt global usrPrompt
@ -1705,6 +1713,11 @@ def UI(usrInput): #Main user menu
usrPrompt = 1 usrPrompt = 1
main() main()
elif usrInput == "shutdown":
shutdown()
usrPrompt = 1
main()
elif usrInput == "million+": elif usrInput == "million+":
genMilAddr() genMilAddr()
usrPrompt = 1 usrPrompt = 1