summaryrefslogtreecommitdiff
path: root/src/op_mode/show_openvpn.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-12-17 08:29:12 +0100
committerGitHub <noreply@github.com>2022-12-17 08:29:12 +0100
commit76cf45917de5ed3a04132029d33a240ebd5877d6 (patch)
tree07ffee72afccd941a60508ba56b6e65424d96bd0 /src/op_mode/show_openvpn.py
parent0c51111829dcd7660fc5405ae6ac651a8b6987b8 (diff)
parentd7a67aa4a7e7bb82a60ad18103abc6b966a2f8b8 (diff)
downloadvyos-1x-76cf45917de5ed3a04132029d33a240ebd5877d6.tar.gz
vyos-1x-76cf45917de5ed3a04132029d33a240ebd5877d6.zip
Merge branch 'current' into goodnetnick-shloginotp-T4754
Diffstat (limited to 'src/op_mode/show_openvpn.py')
-rwxr-xr-xsrc/op_mode/show_openvpn.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/op_mode/show_openvpn.py b/src/op_mode/show_openvpn.py
index 9a5adcffb..e29e594a5 100755
--- a/src/op_mode/show_openvpn.py
+++ b/src/op_mode/show_openvpn.py
@@ -59,7 +59,11 @@ def get_vpn_tunnel_address(peer, interface):
for line in lines:
if peer in line:
lst.append(line)
- tunnel_ip = lst[1].split(',')[0]
+
+ # filter out subnet entries
+ lst = [l for l in lst[1:] if '/' not in l.split(',')[0]]
+
+ tunnel_ip = lst[0].split(',')[0]
return tunnel_ip