summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--op-mode-definitions/openconnect.xml.in10
-rwxr-xr-xsrc/op_mode/openconnect-control.py2
2 files changed, 11 insertions, 1 deletions
diff --git a/op-mode-definitions/openconnect.xml.in b/op-mode-definitions/openconnect.xml.in
index 36f23239e..6b0082b4c 100644
--- a/op-mode-definitions/openconnect.xml.in
+++ b/op-mode-definitions/openconnect.xml.in
@@ -17,4 +17,14 @@
</node>
</children>
</node>
+ <node name="restart">
+ <children>
+ <leafNode name="openconnect-server">
+ <properties>
+ <help>Restart openconnect server process</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/openconnect-control.py --action="restart"</command>
+ </leafNode>
+ </children>
+ </node>
</interfaceDefinition>
diff --git a/src/op_mode/openconnect-control.py b/src/op_mode/openconnect-control.py
index ef9fe618c..c3cd25186 100755
--- a/src/op_mode/openconnect-control.py
+++ b/src/op_mode/openconnect-control.py
@@ -58,7 +58,7 @@ def main():
is_ocserv_configured()
if args.action == "restart":
- run("systemctl restart ocserv")
+ run("sudo systemctl restart ocserv.service")
sys.exit(0)
elif args.action == "show_sessions":
show_sessions()