]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
systemd: add reload target to systemd unit
authorDomonkos P. Tomcsanyi <domi@tomcsanyi.net>
Fri, 24 Jul 2020 14:21:52 +0000 (16:21 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 24 Jul 2020 14:23:47 +0000 (16:23 +0200)
Users can now run `systemctl reload wg-quick@wgnet0`, as described in
the wg-quick(8) man page. Note that this won't adjust Address=, DNS=, or
the various other non-wg(8) fields.

Signed-off-by: Domonkos P. Tomcsanyi <domi@tomcsanyi.net>
[zx2c4: use exec for bash commands to reduce excess forks, and rewrite
        commit message]
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/systemd/wg-quick@.service

index a9cbb5817d77ef37b819c0f4694a54c14e43cbf4..dbdab44fb5fb8f7bafb6bf77c7d482c92620531e 100644 (file)
@@ -15,6 +15,7 @@ Type=oneshot
 RemainAfterExit=yes
 ExecStart=/usr/bin/wg-quick up %i
 ExecStop=/usr/bin/wg-quick down %i
+ExecReload=/bin/bash -c 'exec /usr/bin/wg syncconf %i <(exec /usr/bin/wg-quick strip %i)'
 Environment=WG_ENDPOINT_RESOLUTION_RETRIES=infinity
 
 [Install]