From: Yury Potapov Date: Tue, 15 Oct 2024 15:14:51 +0000 (+0300) Subject: openconnect: introduced script parameter X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=185c5f0387ea26c52ebb12ece8fd0f8c0872c5e2;p=feed%2Fpackages.git openconnect: introduced script parameter This allows specifying a custom vpnc-compatible config script. Signed-off-by: Yury Potapov --- diff --git a/net/openconnect/Makefile b/net/openconnect/Makefile index b169f011d2..c3101919f6 100644 --- a/net/openconnect/Makefile +++ b/net/openconnect/Makefile @@ -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 diff --git a/net/openconnect/README b/net/openconnect/README index edd4a03a9a..8c663b1104 100644 --- a/net/openconnect/README +++ b/net/openconnect/README @@ -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 diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh index 769660091c..69052e767d 100755 --- a/net/openconnect/files/openconnect.sh +++ b/net/openconnect/files/openconnect.sh @@ -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"