diff options
author | Daniil Baturin <daniil@vyos.io> | 2023-12-12 20:36:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-12 20:36:28 +0000 |
commit | b149a386400c0f869654ac26b0fee2e7f1bbc282 (patch) | |
tree | 56e579f8ed8b75d8644583a4833e21d40d3c7b21 /src | |
parent | 48e512ffec259d8753a8fd5a0a6a961f332ab8c1 (diff) | |
parent | 58683a2444877bb989929625ad40a7d76259075d (diff) | |
download | vyos-1x-b149a386400c0f869654ac26b0fee2e7f1bbc282.tar.gz vyos-1x-b149a386400c0f869654ac26b0fee2e7f1bbc282.zip |
Merge pull request #2619 from sever-sever/T5817
T5817: Fix for show openvpn server
Diffstat (limited to 'src')
-rwxr-xr-x | src/op_mode/show_openvpn.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/op_mode/show_openvpn.py b/src/op_mode/show_openvpn.py index e29e594a5..6abafc8b6 100755 --- a/src/op_mode/show_openvpn.py +++ b/src/op_mode/show_openvpn.py @@ -63,9 +63,11 @@ def get_vpn_tunnel_address(peer, interface): # filter out subnet entries lst = [l for l in lst[1:] if '/' not in l.split(',')[0]] - tunnel_ip = lst[0].split(',')[0] + if lst: + tunnel_ip = lst[0].split(',')[0] + return tunnel_ip - return tunnel_ip + return 'n/a' def get_status(mode, interface): status_file = '/var/run/openvpn/{}.status'.format(interface) |