diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-10-18 09:34:47 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-10-18 09:34:47 -0300 |
commit | a06b5719f028e619a4b3800fb346ed3c984e4d25 (patch) | |
tree | b177a28201d647731797efb25c19fd9b3a311c9a /src/leap/bitmask/services/eip/vpnlauncher.py | |
parent | 932dcf596177b93c0b0f9e876be74be314fb6037 (diff) | |
parent | f673b84a9a9b0fea3f6bbfefbb38cbd3d311cf3c (diff) |
Merge branch 'release-0.3.5'0.3.5
Diffstat (limited to 'src/leap/bitmask/services/eip/vpnlauncher.py')
-rw-r--r-- | src/leap/bitmask/services/eip/vpnlauncher.py | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/leap/bitmask/services/eip/vpnlauncher.py b/src/leap/bitmask/services/eip/vpnlauncher.py index 935d75f1..bce3599b 100644 --- a/src/leap/bitmask/services/eip/vpnlauncher.py +++ b/src/leap/bitmask/services/eip/vpnlauncher.py @@ -102,6 +102,8 @@ class VPNLauncher(object): UPDOWN_FILES = None OTHER_FILES = None + UP_SCRIPT = None + DOWN_SCRIPT = None @classmethod @abstractmethod @@ -164,7 +166,7 @@ class VPNLauncher(object): if not gateways: logger.error('No gateway was found!') - raise VPNLauncherException(kls.tr('No gateway was found!')) + raise VPNLauncherException('No gateway was found!') logger.debug("Using gateways ips: {0}".format(', '.join(gateways))) @@ -211,15 +213,17 @@ class VPNLauncher(object): '--script-security', '2' ] - if _has_updown_scripts(kls.UP_SCRIPT): - args += [ - '--up', '\"%s\"' % (kls.UP_SCRIPT,), - ] + if kls.UP_SCRIPT is not None: + if _has_updown_scripts(kls.UP_SCRIPT): + args += [ + '--up', '\"%s\"' % (kls.UP_SCRIPT,), + ] - if _has_updown_scripts(kls.DOWN_SCRIPT): - args += [ - '--down', '\"%s\"' % (kls.DOWN_SCRIPT,) - ] + if kls.DOWN_SCRIPT is not None: + if _has_updown_scripts(kls.DOWN_SCRIPT): + args += [ + '--down', '\"%s\"' % (kls.DOWN_SCRIPT,) + ] ########################################################### # For the time being we are disabling the usage of the @@ -241,6 +245,10 @@ class VPNLauncher(object): '--ca', providerconfig.get_ca_cert_path() ] + args += [ + '--ping', '10', + '--ping-restart', '30'] + command_and_args = [openvpn] + args logger.debug("Running VPN with command:") logger.debug(" ".join(command_and_args)) |