summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiga Murphy <giga1699@gmail.com>2026-05-21 23:15:49 +0000
committerGiga Murphy <giga1699@gmail.com>2026-05-21 23:15:49 +0000
commit81ad0d10ad1df093cb19f715d39696e50f75411a (patch)
treecd2e57ed74a523ab2355e181b2cd15eaefe241fc
parent6fa4967f49e988e4979c611ee9199bb14bef8536 (diff)
downloadvyos-1x-81ad0d10ad1df093cb19f715d39696e50f75411a.tar.gz
vyos-1x-81ad0d10ad1df093cb19f715d39696e50f75411a.zip
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>