summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-08-17 12:08:58 +0200
committerChristian Poessinger <christian@poessinger.com>2019-08-17 12:09:13 +0200
commit7f41c331f9023972097ad8e5b375fdf82843e121 (patch)
tree310a32da7eeaf628bf9ee2f7f66814ef244f5c4e
parent700a3f85bf05b93ea0f1ea42d5efcdd4795ae21f (diff)
downloadvyos-1x-7f41c331f9023972097ad8e5b375fdf82843e121.tar.gz
vyos-1x-7f41c331f9023972097ad8e5b375fdf82843e121.zip
openvpn: T1548: fix enable/disable of entire interface
-rwxr-xr-xsrc/conf_mode/interface-openvpn.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/conf_mode/interface-openvpn.py b/src/conf_mode/interface-openvpn.py
index 339668f5f..67700222c 100755
--- a/src/conf_mode/interface-openvpn.py
+++ b/src/conf_mode/interface-openvpn.py
@@ -233,7 +233,7 @@ push "route {{ route }}"
iroute {{ net }}
{% endfor -%}
-{%- if disabled %}
+{%- if disable %}
disable
{% endif %}
"""
@@ -247,7 +247,7 @@ default_config_data = {
'compress_lzo': False,
'deleted': False,
'description': '',
- 'disabled': False,
+ 'disable': False,
'encryption': '',
'hash': '',
'intf': '',
@@ -377,9 +377,9 @@ def get_config():
if conf.exists('device-type'):
openvpn['type'] = conf.return_value('device-type')
- # interface disabled
- if conf.exists('disabled'):
- openvpn['disabled'] = True
+ # disable interface
+ if conf.exists('disable'):
+ openvpn['disable'] = True
# data encryption algorithm
if conf.exists('encryption'):
@@ -491,7 +491,7 @@ def get_config():
conf.set_level('interfaces openvpn ' + openvpn['intf'] + ' server client ' + client)
data = {
'name': client,
- 'disabled': False,
+ 'disable': False,
'ip': '',
'push_route': [],
'subnet': [],
@@ -513,7 +513,7 @@ def get_config():
# Option to disable client connection
if conf.exists('disable'):
- data['disabled'] = True
+ data['disable'] = True
# IP address of the client
if conf.exists('ip'):
@@ -852,7 +852,7 @@ def apply(openvpn):
pid = int(f.read())
# If tunnel interface has been deleted - stop service
- if openvpn['deleted']:
+ if openvpn['deleted'] or openvpn['disable']:
directory = os.path.dirname(get_config_name(interface))
# we only need to stop the demon if it's running