diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-18 11:48:16 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-18 13:25:08 +0200 |
commit | 5a1a7f42b99e84fb356de646533f79fc8b4afc20 (patch) | |
tree | 6871c29051e67e313663b2034abcbf836fdef179 /src/conf_mode/vpn_l2tp.py | |
parent | deed0ceac983359c3c9d27e584dd3ec8e2e18156 (diff) | |
download | vyos-1x-5a1a7f42b99e84fb356de646533f79fc8b4afc20.tar.gz vyos-1x-5a1a7f42b99e84fb356de646533f79fc8b4afc20.zip |
vpn: l2tp: sstp: ease unlinking of configuration files
Diffstat (limited to 'src/conf_mode/vpn_l2tp.py')
-rwxr-xr-x | src/conf_mode/vpn_l2tp.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/conf_mode/vpn_l2tp.py b/src/conf_mode/vpn_l2tp.py index a8b183bef..06803e7e0 100755 --- a/src/conf_mode/vpn_l2tp.py +++ b/src/conf_mode/vpn_l2tp.py @@ -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 |