fixed broken shutdown command
This commit is contained in:
parent
98dac40139
commit
1a02124122
@ -137,6 +137,7 @@ class API:
|
||||
resp = Response('Hello, World! ' + request.host)
|
||||
elif action == 'shutdown':
|
||||
# request.environ.get('werkzeug.server.shutdown')()
|
||||
self.http_server.stop()
|
||||
resp = Response('Goodbye')
|
||||
elif action == 'ping':
|
||||
resp = Response('pong')
|
||||
@ -151,7 +152,6 @@ class API:
|
||||
self.mimeType = 'text/html'
|
||||
response = siteData.split(b'-', 2)[-1]
|
||||
resp = Response(response)
|
||||
|
||||
else:
|
||||
resp = Response('(O_o) Dude what? (invalid command)')
|
||||
endTime = math.floor(time.time())
|
||||
@ -257,8 +257,8 @@ class API:
|
||||
logger.info('Starting client on ' + self.host + ':' + str(bindPort) + '...', timestamp=True)
|
||||
|
||||
try:
|
||||
http_server = WSGIServer((self.host, bindPort), app)
|
||||
http_server.serve_forever()
|
||||
self.http_server = WSGIServer((self.host, bindPort), app)
|
||||
self.http_server.serve_forever()
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
#app.run(host=self.host, port=bindPort, debug=False, threaded=True)
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
import sys
|
||||
if sys.version_info[0] == 2 or sys.version_info[1] < 5:
|
||||
print('Error, Onionr requires Python 3.4.x+')
|
||||
print('Error, Onionr requires Python 3.4+')
|
||||
sys.exit(1)
|
||||
import os, base64, random, getpass, shutil, subprocess, requests, time, platform, datetime, re
|
||||
from threading import Thread
|
||||
|
Loading…
Reference in New Issue
Block a user