summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/app2.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2017-12-19 22:36:26 +0100
committerKali Kaneko <kali@leap.se>2017-12-20 15:36:50 +0100
commitfede250a96c17b1a3344dc05767f0311c749cef2 (patch)
tree93e015087b92dbce21e44ecedd0cc9af33ccf832 /src/leap/bitmask/gui/app2.py
parentfdf66fccc0b1c2f169bfd72166add45ea3959488 (diff)
[feat] remove status files on shutdown
Diffstat (limited to 'src/leap/bitmask/gui/app2.py')
-rw-r--r--src/leap/bitmask/gui/app2.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/leap/bitmask/gui/app2.py b/src/leap/bitmask/gui/app2.py
index f243c27a..28c5a380 100644
--- a/src/leap/bitmask/gui/app2.py
+++ b/src/leap/bitmask/gui/app2.py
@@ -140,13 +140,16 @@ class BrowserWindow(object):
pidno = int(f.read())
print('[bitmask] terminating bitmaskd...')
os.kill(pidno, signal.SIGTERM)
+ self.cleanup()
print('[bitmask] shutting down gui...')
def cleanup(self):
- # TODO get path-----------------------------------
- os.remove('/Users/' + getpass.getuser() +
- '/Library/Preferences/leap/bitmasd.pid')
- # ------------------------------------------------
+ base = os.path.join(get_path_prefix(), 'leap')
+ token = os.path.join(base, 'authtoken')
+ pid = os.path.join(base, 'bitmaskd.pid')
+ for _f in [token, pid]:
+ if os.path.isfile(_f):
+ os.unlink(_f)
def launch_gui():