config interface 'MYVPN'
option proto 'openconnect'
option interface 'wan'
- option server 'vpn.example.com'
- option port '4443'
+ option uri 'https://vpn.example.com:4443'
option username 'test'
option password 'secret'
option serverhash 'AE7FF6A0426F0A0CD0A02EB9EC3C5066FAEB0B25'
proto_openconnect_init_config() {
proto_config_add_string "server"
proto_config_add_int "port"
+ proto_config_add_string "uri"
proto_config_add_int "mtu"
proto_config_add_int "juniper"
proto_config_add_int "reconnect_timeout"
proxy \
reconnect_timeout \
server \
+ uri \
serverhash \
token_mode \
token_script \
[ -n "$interface" ] && {
local trials=5
+ [ -n $uri ] && server=$(echo $uri | awk -F[/:] '{print $4}')
+
logger -t "openconnect" "adding host dependency for $server at $config"
while resolveip -t 10 "$server" > "$tmpfile" && [ "$trials" -gt 0 ]; do
sleep 5
}
[ -n "$port" ] && port=":$port"
+ [ -z "$uri" ] && uri="$server$port"
- append_args "$server$port" -i "$ifname" --non-inter --syslog --script /lib/netifd/vpnc-script
+ append_args "$uri" -i "$ifname" --non-inter --syslog --script /lib/netifd/vpnc-script
[ "$pfs" = 1 ] && append_args --pfs
[ "$no_dtls" = 1 ] && append_args --no-dtls
[ -n "$mtu" ] && append_args --mtu "$mtu"