From bbf13f9d891904d104ad872a4b6fc3a5b5e40e22 Mon Sep 17 00:00:00 2001 From: Matthew Hagan Date: Sat, 16 Oct 2021 12:40:33 +0100 Subject: [PATCH] openfortivpn: add persistent reconnect option Currently when the connection times out, the interface will disconnect. Add capability to add persistent option to re-establish connectivity. Signed-off-by: Matthew Hagan --- net/openfortivpn/files/openfortivpn.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/openfortivpn/files/openfortivpn.sh b/net/openfortivpn/files/openfortivpn.sh index 929a0772a..0924d4250 100755 --- a/net/openfortivpn/files/openfortivpn.sh +++ b/net/openfortivpn/files/openfortivpn.sh @@ -19,6 +19,7 @@ proto_openfortivpn_init_config() { proto_config_add_string "local_ip" proto_config_add_string "username" proto_config_add_string "password" + proto_config_add_int "persist_int" proto_config_add_string "trusted_cert" proto_config_add_string "remote_status_check" no_device=1 @@ -30,10 +31,10 @@ proto_openfortivpn_setup() { local msg ifname ip server_ips pwfile callfile - local peeraddr port tunlink local_ip username password trusted_cert \ - remote_status_check - json_get_vars host peeraddr port tunlink local_ip username password trusted_cert \ - remote_status_check + local peeraddr port tunlink local_ip username password persist_int \ + trusted_cert remote_status_check + json_get_vars host peeraddr port tunlink local_ip username password persist_int \ + trusted_cert remote_status_check ifname="vpn-$config" @@ -116,6 +117,7 @@ proto_openfortivpn_setup() { append_args "--ifname=$iface_device_name" } + [ -n "$persist_int" ] && append_args "--persistent=$persist_int" [ -n "$trusted_cert" ] && append_args "--trusted-cert=$trusted_cert" [ -n "$username" ] && append_args -u "$username" [ -n "$password" ] && {