diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-18 14:33:57 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-18 14:33:57 +0200 |
commit | 56fb2cf15b765efdad77c111bbd5294f296d7223 (patch) | |
tree | 244c66d2e4f9b576f784fbad6d0a0c100521cb99 /src/conf_mode/vpn_l2tp.py | |
parent | 8d8fea6428cf7687757f14592cc345bf0804b993 (diff) | |
parent | 267b3213ef0e6ac4501470bef797796276879421 (diff) | |
download | vyos-1x-56fb2cf15b765efdad77c111bbd5294f296d7223.tar.gz vyos-1x-56fb2cf15b765efdad77c111bbd5294f296d7223.zip |
Merge branch 'pppoe-server-update' of github.com:c-po/vyos-1x into current
* 'pppoe-server-update' of github.com:c-po/vyos-1x:
accel-ppp: T2314: use common tempplate for chap-secrets
pppoe-server: T2314: migrate IPv6 to common CLI nodes with embeeded validation
pppoe-server: T2313: bugfix Floating Point Exception
pppoe-server: T2314: migrate RADIUS configuration to common CLI syntax
vpn: l2tp: pptp: sstp: rename files to common pattern
pppoe-server: T2314: migrate IPv4/IPv6 name-servers to common node
vpn: l2tp: sstp: ease unlinking of configuration files
pppoe-server: T2314: remove boilerplate code and adjust
pppoe-server: T2185: migrate from SysVinit to systemd
Diffstat (limited to 'src/conf_mode/vpn_l2tp.py')
-rwxr-xr-x | src/conf_mode/vpn_l2tp.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/conf_mode/vpn_l2tp.py b/src/conf_mode/vpn_l2tp.py index a8b183bef..417520e09 100755 --- a/src/conf_mode/vpn_l2tp.py +++ b/src/conf_mode/vpn_l2tp.py @@ -252,7 +252,7 @@ def get_config(): 'mask': '' } - if conf.exists(['client-ipv6-pool', 'delegate', prefix, 'mask']): + if conf.exists(['client-ipv6-pool', 'delegate', prefix, 'delegation-prefix']): tmp['mask'] = conf.return_value(['client-ipv6-pool', 'delegate', prefix, 'delegation-prefix']) l2tp['client_ipv6_delegate_prefix'].append(tmp) @@ -348,10 +348,10 @@ def generate(l2tp): if not os.path.exists(dirname): os.mkdir(dirname) - render(l2tp_conf, 'l2tp/l2tp.config.tmpl', c, trim_blocks=True) + render(l2tp_conf, 'accel-ppp/l2tp.config.tmpl', c, trim_blocks=True) if l2tp['auth_mode'] == 'local': - render(l2tp_chap_secrets, 'l2tp/chap-secrets.tmpl', l2tp) + render(l2tp_chap_secrets, 'accel-ppp/chap-secrets.tmpl', l2tp) os.chmod(l2tp_chap_secrets, S_IRUSR | S_IWUSR | S_IRGRP) else: @@ -364,12 +364,9 @@ def generate(l2tp): def apply(l2tp): if not l2tp: call('systemctl stop accel-ppp@l2tp.service') - - if os.path.exists(l2tp_conf): - os.unlink(l2tp_conf) - - if os.path.exists(l2tp_chap_secrets): - os.unlink(l2tp_chap_secrets) + for file in [l2tp_chap_secrets, l2tp_conf]: + if os.path.exists(file): + os.unlink(file) return None |