summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/autostart.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-03-27 13:31:12 +0200
committerKali Kaneko <kali@leap.se>2018-03-28 23:51:26 +0200
commit60903c2515391384b67f9d3a7c6d5c810db0e946 (patch)
tree23b0f70bbb6967f22d3bb2030a51dec1044edff8 /src/leap/bitmask/vpn/autostart.py
parentdcbbda4dbd442340cbc46e2f1a476cb21e12ca0f (diff)
[refactor] move autostart code into core
All the logic to autostart bitmask should not be vpn dependent.
Diffstat (limited to 'src/leap/bitmask/vpn/autostart.py')
-rw-r--r--src/leap/bitmask/vpn/autostart.py45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/leap/bitmask/vpn/autostart.py b/src/leap/bitmask/vpn/autostart.py
deleted file mode 100644
index 1c361d82..00000000
--- a/src/leap/bitmask/vpn/autostart.py
+++ /dev/null
@@ -1,45 +0,0 @@
-import os
-import os.path
-
-from leap.bitmask.system import IS_LINUX, IS_MAC
-from leap.bitmask.util import STANDALONE
-from leap.common.config import get_path_prefix
-
-if IS_LINUX:
- AUTOSTART = r"""[Desktop Entry]
-Name=Bitmask
-Type=Application
-Exec=bitmask
-Terminal=false
-"""
- config = get_path_prefix(standalone=False)
- autostart_file = os.path.join(config, 'autostart', 'bitmask.desktop')
-
- def autostart_app(status):
- """
- Leave an autostart file in the user's autostart path.
-
- The bundle could in principle find its own path and add
- the path to the bitmaskd binary in the Exec entry.
- But for now it's simpler to do autostart only for the debian packages
- or any other method that puts bitmask in the path.
- On the other hand, we want to reduce the modifications that the bundle
- leaves behind.
- """
- if not STANDALONE:
- if status == 'on':
- _dir = os.path.split(autostart_file)[0]
- if not os.path.isdir(_dir):
- os.makedirs(_dir)
- with open(autostart_file, 'w') as f:
- f.write(AUTOSTART)
- elif status == 'off':
- try:
- os.unlink(autostart_file)
- except OSError:
- pass
-
-if IS_MAC:
-
- def autostart_app(status):
- pass