diff options
author | Yousong Zhou <yszhou4tech@gmail.com> | 2019-09-20 09:22:54 +0000 |
---|---|---|
committer | Yousong Zhou <yszhou4tech@gmail.com> | 2019-09-21 10:33:18 +0000 |
commit | 384398d452180aaeb39c3163d172990fc7359c3a (patch) | |
tree | 92f89fb2f54818e4d55fd5632f033fadc751e099 /net/openconnect/files | |
parent | 61423689f9d09c56dd0e6c5fc34e7a2449d1dd7b (diff) |
openconnect: allow specifying form_entry list
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'net/openconnect/files')
-rwxr-xr-x | net/openconnect/files/openconnect.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh index dc1d42b80..15bd3b5a5 100755 --- a/net/openconnect/files/openconnect.sh +++ b/net/openconnect/files/openconnect.sh @@ -19,14 +19,19 @@ proto_openconnect_init_config() { proto_config_add_string "token_script" proto_config_add_string "os" proto_config_add_string "csd_wrapper" + proto_config_add_array 'form_entry:regex("[^:]+:[^=]+=.*")' no_device=1 available=1 } +proto_openconnect_add_form_entry() { + [ -n "$1" ] && append cmdline "--form-entry $1" +} + proto_openconnect_setup() { local config="$1" - json_get_vars server port interface username serverhash authgroup password password2 token_mode token_secret token_script os csd_wrapper mtu juniper + json_get_vars server port interface username serverhash authgroup password password2 token_mode token_secret token_script os csd_wrapper mtu juniper form_entry grep -q tun /proc/modules || insmod tun ifname="vpn-$config" @@ -88,6 +93,8 @@ proto_openconnect_setup() { [ -n "$os" ] && append cmdline "--os=$os" [ -n "$csd_wrapper" ] && [ -x "$csd_wrapper" ] && append cmdline "--csd-wrapper=$csd_wrapper" + json_for_each_item proto_openconnect_add_form_entry form_entry + proto_export INTERFACE="$config" logger -t openconnect "executing 'openconnect $cmdline'" |