summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/platform_init
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/platform_init')
-rw-r--r--src/leap/bitmask/platform_init/initializers.py28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/leap/bitmask/platform_init/initializers.py b/src/leap/bitmask/platform_init/initializers.py
index 859e7fe6..b7946c4c 100644
--- a/src/leap/bitmask/platform_init/initializers.py
+++ b/src/leap/bitmask/platform_init/initializers.py
@@ -401,39 +401,27 @@ def _linux_install_missing_scripts(badexec, notfound):
os.path.join(os.getcwd(), "apps", "eip", "files"))
launcher = LinuxVPNLauncher
- # XXX refactor with darwin, same block.
+ install_helper = "linux-install-helper.sh"
+ install_helper_path = os.path.join(installer_path, install_helper)
- if os.path.isdir(installer_path):
+ install_opts = ("--from-path %s --install-bitmask-root YES"
+ "--install-polkit-file YES --install-openvpn YES" % (
+ installer_path,))
- # FIXME --------- call installer script ---
- fd, tempscript = tempfile.mkstemp(prefix="leap_installer-")
- polfd, pol_tempfile = tempfile.mkstemp(prefix="leap_installer-")
+ if os.path.isdir(installer_path):
try:
pkexec = first(launcher.maybe_pkexec())
-
- scriptlines = launcher.cmd_for_missing_scripts(installer_path)
- with os.fdopen(fd, 'w') as f:
- f.write(scriptlines)
-
- st = os.stat(tempscript)
- os.chmod(tempscript, st.st_mode | stat.S_IEXEC | stat.S_IXUSR |
- stat.S_IXGRP | stat.S_IXOTH)
- cmdline = ["%s %s" % (pkexec, tempscript)]
+ cmdline = ["%s %s" % (pkexec, install_helper_path, install_opts)]
ret = subprocess.call(
cmdline, stdout=subprocess.PIPE,
shell=True)
success = ret == 0
if not success:
- logger.error("Install missing scripts failed.")
+ logger.error("Install of helpers failed.")
except Exception as exc:
logger.error(badexec)
logger.error("Error was: %r" % (exc,))
- finally:
- try:
- os.remove(tempscript)
- except OSError as exc:
- logger.error("%r" % (exc,))
else:
logger.error(notfound)
logger.debug('path searched: %s' % (installer_path,))