summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-05-22 20:31:42 +0200
committerGitHub <noreply@github.com>2026-05-22 20:31:42 +0200
commit9554a316c80ac808a6b94f098484380cc422e597 (patch)
treea9006bb02fae9c79abc9fc407ca252012e67849a
parent44034365f053f8496671a13d28e777e0e0fd93a7 (diff)
parent81ad0d10ad1df093cb19f715d39696e50f75411a (diff)
downloadvyos-1x-9554a316c80ac808a6b94f098484380cc422e597.tar.gz
vyos-1x-9554a316c80ac808a6b94f098484380cc422e597.zip
Merge pull request #5214 from giga1699/T7654
openconnect: T7654: OpenConnect Script Execution
-rw-r--r--data/templates/ocserv/ocserv_config.j28
-rw-r--r--interface-definitions/vpn_openconnect.xml.in31
2 files changed, 39 insertions, 0 deletions
diff --git a/data/templates/ocserv/ocserv_config.j2 b/data/templates/ocserv/ocserv_config.j2
index 76d3e6e4e..e8549b1bb 100644
--- a/data/templates/ocserv/ocserv_config.j2
+++ b/data/templates/ocserv/ocserv_config.j2
@@ -50,6 +50,14 @@ default-user-config = {{ authentication.identity_based_config.default_config }}
{% endif %}
{% endif %}
+{% if script.connect is vyos_defined %}
+connect-script = {{ script.connect }}
+{% endif %}
+
+{% if script.disconnect is vyos_defined %}
+disconnect-script = {{ script.disconnect }}
+{% endif %}
+
{% if ssl.certificate is vyos_defined %}
server-cert = /run/ocserv/cert.pem
server-key = /run/ocserv/cert.key
diff --git a/interface-definitions/vpn_openconnect.xml.in b/interface-definitions/vpn_openconnect.xml.in
index fc90e5865..e9280cd12 100644
--- a/interface-definitions/vpn_openconnect.xml.in
+++ b/interface-definitions/vpn_openconnect.xml.in
@@ -420,6 +420,37 @@
</leafNode>
</children>
</node>
+ <node name="script">
+ <properties>
+ <help>Execute script on client connect/disconnect</help>
+ </properties>
+ <children>
+ <leafNode name="connect">
+ <properties>
+ <help>Script to execute upon client connecting</help>
+ <valueHelp>
+ <format>filename</format>
+ <description>Client connect script, must be under /config/scripts</description>
+ </valueHelp>
+ <constraint>
+ <validator name="file-path" argument="--file --parent-dir /config/scripts --strict"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="disconnect">
+ <properties>
+ <help>Script to execute upon client disconnecting</help>
+ <valueHelp>
+ <format>filename</format>
+ <description>Client disconnect script, must be under /config/scripts</description>
+ </valueHelp>
+ <constraint>
+ <validator name="file-path" argument="--file --parent-dir /config/scripts --strict"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
</children>
</node>
</children>