From 0919c5e200493f7866b6abfa5c777e2ba7fd8f42 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 19 Mar 2022 01:18:14 +0300 Subject: add persistent-keepalive to `wg set` --- assets/js/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'assets/js') diff --git a/assets/js/main.js b/assets/js/main.js index 21b5d62..8a6555d 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -901,10 +901,14 @@ function manual_client_script(data) { var path = 'client_setup.sh'; var allowed_ips = `${data.client_ipv4.allowed_ips_client()},${data.client_ipv6.allowed_ips_client()}`; + var keepalive = ''; if (data.tunnel_everything.value) { allowed_ips = `${catchall_ipv4},${catchall_ipv6}`; } + if (data.keepalive.is_set()) { + keepalive = ` persistent-keepalive ${data.keepalive.value} \\\n`; + } var contents = `# On the client, run this to set up a connection. @@ -918,7 +922,7 @@ wg set ${iface} \\ wg set ${iface} \\ peer ${data.server_public.value} \\ preshared-key <( echo ${data.preshared.value} ) \\ - endpoint ${data.server_endpoint.value} \\ +${keepalive} endpoint ${data.server_endpoint.value} \\ allowed-ips ${allowed_ips} ip link set ${iface} up `; -- cgit v1.2.3