summaryrefslogtreecommitdiff
path: root/src/op_mode/openvpn.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-02-21 17:50:26 +0100
committerGitHub <noreply@github.com>2023-02-21 17:50:26 +0100
commit0a36a0306a451e81c291c5a252ece7b3ef2d6804 (patch)
tree324d2e1639684b94fc0884880ac77af2904ad31b /src/op_mode/openvpn.py
parent4c6860d259cf7109de909d893b497c5b47c11064 (diff)
parentbcda665791e59d4acca02187db9b54f93b1763fc (diff)
downloadvyos-1x-0a36a0306a451e81c291c5a252ece7b3ef2d6804.tar.gz
vyos-1x-0a36a0306a451e81c291c5a252ece7b3ef2d6804.zip
Merge pull request #1835 from sever-sever/T5020
T5020: Extend openvpn op-mode to get list of configured clients
Diffstat (limited to 'src/op_mode/openvpn.py')
-rwxr-xr-xsrc/op_mode/openvpn.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/op_mode/openvpn.py b/src/op_mode/openvpn.py
index 3797a7153..d957a1d01 100755
--- a/src/op_mode/openvpn.py
+++ b/src/op_mode/openvpn.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2022 VyOS maintainers and contributors
+# Copyright (C) 2022-2023 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -153,6 +153,8 @@ def _get_raw_data(mode: str) -> dict:
d = data[intf]
d['local_host'] = conf_dict[intf].get('local-host', '')
d['local_port'] = conf_dict[intf].get('local-port', '')
+ if conf.exists(f'interfaces openvpn {intf} server client'):
+ d['configured_clients'] = conf.list_nodes(f'interfaces openvpn {intf} server client')
if mode in ['client', 'site-to-site']:
for client in d['clients']:
if 'shared-secret-key-file' in list(conf_dict[intf]):