From fede250a96c17b1a3344dc05767f0311c749cef2 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 19 Dec 2017 22:36:26 +0100 Subject: [feat] remove status files on shutdown --- src/leap/bitmask/gui/app2.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') 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(): -- cgit v1.2.3