aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-03-19 01:18:14 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2022-03-19 01:18:14 +0300
commit0919c5e200493f7866b6abfa5c777e2ba7fd8f42 (patch)
tree670fd220efc239d0b13be3fc9b995c150e96ffa5
parentmain.js: refactor overlay buttons (diff)
downloadwireguard-config-0919c5e200493f7866b6abfa5c777e2ba7fd8f42.tar.gz
wireguard-config-0919c5e200493f7866b6abfa5c777e2ba7fd8f42.zip
add persistent-keepalive to `wg set`
-rw-r--r--assets/js/main.js6
1 files changed, 5 insertions, 1 deletions
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
`;