summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-01-25 17:15:47 +0000
committerGitHub <noreply@github.com>2024-01-25 17:15:47 +0000
commitee19ebbfad4d0f1293d95e0d0da216d851d71929 (patch)
tree75628e26458f3ff947b1257e2a6e631251703385
parent80d6813cad2451c95e809717a5e8d9264d483041 (diff)
parentc13628bca37ae6dd522d2db135a839c19f61993e (diff)
downloadvyos-1x-ee19ebbfad4d0f1293d95e0d0da216d851d71929.tar.gz
vyos-1x-ee19ebbfad4d0f1293d95e0d0da216d851d71929.zip
Merge pull request #2894 from vyos/mergify/bp/current/pr-2619
T5817: Fix for show openvpn server (backport #2619)
-rwxr-xr-xsrc/op_mode/show_openvpn.py6
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)