From eec31994e1babb37a18c1928a00723a07ffc9808 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Thu, 29 Aug 2019 01:16:30 +0100 Subject: [PATCH] Do not disconnect from VPN over cellular if security level is medium --- features/gen_basic.feature | 2 +- lib/ovpnmcgen.rb | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/features/gen_basic.feature b/features/gen_basic.feature index 07a75ff..7eef210 100644 --- a/features/gen_basic.feature +++ b/features/gen_basic.feature @@ -378,7 +378,7 @@ Feature: Basic Generate Functionality And the output should match: """ Action - \s*Disconnect + \s*Ignore \s*InterfaceTypeMatch \s*Cellular """ diff --git a/lib/ovpnmcgen.rb b/lib/ovpnmcgen.rb index ceebecd..105cddf 100644 --- a/lib/ovpnmcgen.rb +++ b/lib/ovpnmcgen.rb @@ -133,14 +133,14 @@ def generate(inputs = {}) vodCellularOnly = { # Trust Cellular 'InterfaceTypeMatch' => 'Cellular', 'Action' => case inputs[:security_level] - when 'paranoid' - 'Connect' - when 'high' - 'Ignore' - else # medium - 'Disconnect' - end + when 'paranoid' + 'Connect' + else # high, medium + 'Ignore' + end } + + # Default catch-all to prevent circular race. vodDefault = { # Default catch-all 'Action' => 'Ignore' }