summaryrefslogtreecommitdiff
path: root/src/op_mode/show_openvpn.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/op_mode/show_openvpn.py')
-rwxr-xr-xsrc/op_mode/show_openvpn.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/op_mode/show_openvpn.py b/src/op_mode/show_openvpn.py
index 23a8156ec..577ed7eb7 100755
--- a/src/op_mode/show_openvpn.py
+++ b/src/op_mode/show_openvpn.py
@@ -18,6 +18,7 @@
import jinja2
import argparse
+from sys import exit
from vyos.config import Config
outp_tmpl = """
@@ -136,7 +137,7 @@ if __name__ == '__main__':
config = Config()
if len(config.list_effective_nodes('interfaces openvpn')) == 0:
print("No OpenVPN interfaces configured")
- sys.exit(0)
+ exit(0)
# search all OpenVPN interfaces and add those with a matching mode to our
# interfaces list
@@ -161,6 +162,10 @@ if __name__ == '__main__':
remote_host = config.return_effective_values('interfaces openvpn {} remote-host'.format(intf))
remote_port = config.return_effective_value('interfaces openvpn {} remote-port'.format(intf))
+
+ if not remote_port:
+ remote_port = '1194'
+
if len(remote_host) >= 1:
client['remote'] = str(remote_host[0]) + ':' + remote_port