openconnect: allow specifying a custom CSD wrapper script

Some VPN servers might be configured in a way that a CSD wrapper script
is mandatory to complete the authentication process, allow that to be
specified for openconnect.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
This commit is contained in:
Florian Fainelli
2015-04-04 12:32:59 -07:00
parent 70c10c0a5e
commit b1f228f4cf
+3 -1
View File
@@ -14,6 +14,7 @@ proto_openconnect_init_config() {
proto_config_add_string "token_secret"
proto_config_add_string "interface"
proto_config_add_string "os"
proto_config_add_string "csd_wrapper"
no_device=1
available=1
}
@@ -21,7 +22,7 @@ proto_openconnect_init_config() {
proto_openconnect_setup() {
local config="$1"
json_get_vars server port username serverhash authgroup password interface token_mode token_secret os
json_get_vars server port username serverhash authgroup password interface token_mode token_secret os csd_wrapper
grep -q tun /proc/modules || insmod tun
@@ -70,6 +71,7 @@ proto_openconnect_setup() {
[ -n "$token_mode" ] && append cmdline "--token-mode=$token_mode"
[ -n "$token_secret" ] && append cmdline "--token-secret=$token_secret"
[ -n "$os" ] && append cmdline "--os=$os"
[ -n "$csd_wrapper" ] && [ -x "$csd_wrapper" ] && append cmdline "--csd-wrapper=$csd_wrapper"
proto_export INTERFACE="$config"
logger -t openconnect "executing 'openconnect $cmdline'"