openconnect: add options to support juniper

Signed-off-by: Vladimir Berezhnoy <non7top@gmail.com>
This commit is contained in:
Vladimir Berezhnoy
2017-11-07 13:11:34 +03:00
parent 91dc4e824d
commit d710c629e8
3 changed files with 15 additions and 5 deletions
+7 -1
View File
@@ -7,6 +7,7 @@ proto_openconnect_init_config() {
proto_config_add_string "server"
proto_config_add_int "port"
proto_config_add_int "mtu"
proto_config_add_int "juniper"
proto_config_add_string "username"
proto_config_add_string "serverhash"
proto_config_add_string "authgroup"
@@ -23,7 +24,7 @@ proto_openconnect_init_config() {
proto_openconnect_setup() {
local config="$1"
json_get_vars server port username serverhash authgroup password password2 token_mode token_secret os csd_wrapper mtu
json_get_vars server port username serverhash authgroup password password2 token_mode token_secret os csd_wrapper mtu juniper
grep -q tun /proc/modules || insmod tun
ifname="vpn-$config"
@@ -52,6 +53,11 @@ proto_openconnect_setup() {
append cmdline "--cafile /etc/openconnect/ca-vpn-$config.pem"
append cmdline "--no-system-trust"
}
if [ "${juniper:-0}" -gt 0 ]; then
append cmdline "--juniper"
fi
[ -n "$serverhash" ] && {
append cmdline " --servercert=$serverhash"
append cmdline "--no-system-trust"