diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-08-19 12:39:06 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-08-19 13:15:17 +0200 |
commit | 239bb736bcd29c2f78f47b601083e21fce8e41b9 (patch) | |
tree | fc84b17bce17cfd67e8d8a7685a86ecf1d6b3d5a /contrib | |
parent | 22902cc31da5dcf6941ab01eed105495444ef5b1 (diff) | |
download | NetworkManager-239bb736bcd29c2f78f47b601083e21fce8e41b9.tar.gz |
nm-import-openvpn: import 'keepalive' option
https://bugzilla.gnome.org/show_bug.cgi?id=651657
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=6afd16bcacd87a019e12f4df0d63a9e0e8c94e9e
(cherry picked from commit 02cfeac668a21368ca8cede5a53ea4aceabf5031)
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/scripts/nm-import-openvpn | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/scripts/nm-import-openvpn b/contrib/scripts/nm-import-openvpn index adc694462c..d01140dd3b 100755 --- a/contrib/scripts/nm-import-openvpn +++ b/contrib/scripts/nm-import-openvpn @@ -145,6 +145,14 @@ function handle_ifconfig(t, option, value) t[option[1]] = value[2] t[option[2]] = value[3] end +function handle_keepalive(t, option, value) + if (not (value[2] and value[3])) or (not tonumber(value[2]) or not tonumber(value[3])) then + io.stderr:write("Warning: ignoring invalid option 'keepalive'; two numbers required\n") + return + end + t[option[1]] = value[2] + t[option[2]] = value[3] +end function handle_path(t, option, value) if value[1] == "pkcs12" then t["ca"] = value[2] @@ -181,6 +189,7 @@ vpn2nm = { ["cert"] = { nm_opt="cert", func=handle_path }, ["cipher"] = { nm_opt="cipher", func=handle_generic }, ["keysize"] = { nm_opt="keysize", func=handle_generic }, + ["keepalive"] = { nm_opt={"ping", "ping-restart"}, func=handle_keepalive }, ["client"] = { nm_opt="client", func=set_bool }, ["comp-lzo"] = { nm_opt="comp-lzo", func=handle_yes }, ["float"] = { nm_opt="float", func=handle_yes }, |