summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core/_web.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-09-06 22:22:07 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-09-06 23:00:57 -0400
commit5a3fb4eb5a24e250a75dac4a2a39ce5632a175b6 (patch)
tree2731d5daf3cb50985b21ecf258c8ecf193945471 /src/leap/bitmask/core/_web.py
parente60b252247247e812bc8b9ae5726150cbd96d923 (diff)
[feat] add webui command: enable/disable/status
Diffstat (limited to 'src/leap/bitmask/core/_web.py')
-rw-r--r--src/leap/bitmask/core/_web.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/leap/bitmask/core/_web.py b/src/leap/bitmask/core/_web.py
index 3f39e43..c597d18 100644
--- a/src/leap/bitmask/core/_web.py
+++ b/src/leap/bitmask/core/_web.py
@@ -71,10 +71,17 @@ class HTTPDispatcherService(service.Service):
# TODO use endpoints instead
self.listener = reactor.listenTCP(self.port, site,
interface='127.0.0.1')
+ self.running = True
def stopService(self):
self.site.stopFactory()
self.listener.stopListening()
+ self.running = False
+
+ def do_status(self):
+ status = 'running' if self.running else 'disabled'
+ return {'web': status}
+
class Api(Resource):