diff options
author | Kali Kaneko <kali@leap.se> | 2014-06-17 11:25:11 -0500 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2014-06-17 13:15:39 -0500 |
commit | 89d126e96b1ed3ac1076b3c45129f8bc78a09700 (patch) | |
tree | 02c28c675a9883d52360acac53d4158f4c36459d /src | |
parent | 9dd06067e6bfa475c633a1edcae8d3c318b9f0f5 (diff) |
use bash installer instead of the temporal script
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/bitmask/platform_init/initializers.py | 28 |
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,)) |