work on cliui

master
Kevin Froman 2018-09-01 23:55:24 -05:00
parent c142ab770a
commit 083003191f
2 changed files with 7 additions and 5 deletions

View File

@ -389,6 +389,7 @@ class Core:
conn.close()
except sqlite3.OperationalError:
retData = False
self.daemonQueue()
events.event('queue_push', data = {'command': command, 'data': data}, onionr = None)
return retData

View File

@ -53,7 +53,7 @@ class OnionrCLIUI:
while showMenu:
if firstRun:
print("please wait while Onionr starts...")
subprocess.Popen(["./onionr.py", "start"], stdin=subprocess.PIPE, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
daemon = subprocess.Popen(["./onionr.py", "start"], stdin=subprocess.PIPE, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
time.sleep(30)
firstRun = False
@ -93,12 +93,13 @@ Daemon Running: ''' + isOnline + '''
print("Onionr daemon will shutdown...")
#self.myCore._utils.localCommand("shutdown")
self.myCore.daemonQueueAdd('shutdown')
while self.myCore._utils.localCommand('ping') == 'pong':
self.myCore.daemonQueueAdd('shutdown')
time.sleep(8)
try:
daemon.kill()
except UnboundLocalError:
pass
else:
print("Starting Daemon...")
subprocess.Popen(["./onionr.py", "start"], stdin=subprocess.PIPE, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
daemon = subprocess.Popen(["./onionr.py", "start"], stdin=subprocess.PIPE, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
elif choice in ("6", "quit"):
showMenu = False
elif choice == "":