openconnect: introduced script parameter
authorYury Potapov <me@immensus.net>
Tue, 15 Oct 2024 15:14:51 +0000 (18:14 +0300)
committerNikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
Thu, 31 Oct 2024 13:36:39 +0000 (14:36 +0100)
This allows specifying a custom vpnc-compatible config script.

Signed-off-by: Yury Potapov <me@immensus.net>
net/openconnect/Makefile
net/openconnect/README
net/openconnect/files/openconnect.sh

index b169f011d2a893a245cc9efedd5471b0f3b6a352..c3101919f6a0c2800df2610a6d6137a80d82658f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openconnect
 PKG_VERSION:=9.12
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.infradead.org/openconnect/download
index edd4a03a9acec65230c63bbe8fd7126246d34ad9..8c663b1104c2cbf5fe21b5c787cf9c58b83e43a5 100644 (file)
@@ -18,6 +18,9 @@ config interface 'MYVPN'
        # Reconnect after a temporary network down time (in seconds)
        #option reconnect_timeout '30'
 
+       # Shell command line for using a vpnc-compatible config script (default: "/lib/netifd/vpnc-script")
+       # option script '/lib/netifd/vpnc-script'
+
        # For second factor auth:
 
        # when a fixed 2FA password can be used
index 769660091c46f7669a984d4cb06e111fe3da88df..69052e767d5a99830fee8e5222e20abdca766acf 100755 (executable)
@@ -37,6 +37,7 @@ proto_openconnect_init_config() {
        proto_config_add_string "csd_wrapper"
        proto_config_add_string "proxy"
        proto_config_add_array 'form_entry:regex("[^:]+:[^=]+=.*")'
+       proto_config_add_string "script"
        no_device=1
        available=1
 }
@@ -73,6 +74,7 @@ proto_openconnect_setup() {
                token_secret \
                usergroup \
                username \
+               script \
 
        ifname="vpn-$config"
 
@@ -101,7 +103,8 @@ proto_openconnect_setup() {
        [ -n "$port" ] && port=":$port"
        [ -z "$uri" ] && uri="$server$port"
 
-       append_args "$uri" -i "$ifname" --non-inter --syslog --script /lib/netifd/vpnc-script
+       append_args "$uri" -i "$ifname" --non-inter --syslog
+       [ -n "$script" ] && append_args --script "$script"
        [ "$pfs" = 1 ] && append_args --pfs
        [ "$no_dtls" = 1 ] && append_args --no-dtls
        [ -n "$mtu" ] && append_args --mtu "$mtu"