Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Conrad Meyer <cem@freebsd.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Bug in helper contrib/examples/reresolve-dns/reresolve-dns.sh
Date: Wed, 27 Nov 2019 10:23:33 -0800	[thread overview]
Message-ID: <CAG6CVpVzkmt++KR6A=gzGG_cDC9Pusw6LhwnVUBSwTgEkULhnQ@mail.gmail.com> (raw)
In-Reply-To: <CAHmME9pzEg9sn1PJMXrmttWjYvSzsRRfXugphES5kPPhqN2WZw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1914 bytes --]

Thanks for fixing it so quickly!

Would it be possible to use env as the interpreter for systems which don't
place bash directly in /bin?  I think that's my only other significant
local modification to the script on my BSD systems.  I.e.,

-#!/bin/bash
+#!/usr/bin/env bash

Best regards,
Conrad

P.S., If it is helpful, I also have some example SystemD unit files for
connecting this script up in that universe, which I'm pretty sure I stole
from ArchWiki (https://wiki.archlinux.org/index.php/WireGuard) but I don't
remember at this point.  It might be nice to other users to shove some
version of them in the examples/reresolve-dns directory as an example for
folks on systemd.

$ cat wg-reresolve-dns.timer
[Unit]
Description=Periodically reresolve DNS of Wireguard endpoints that have
stopped responding

[Timer]
OnCalendar=*:*:0/30

[Install]
WantedBy=timers.target

# The hardcoded wgnet0 below could probably be transformed into
an @.service, like wg-quick@.service.  Also, dnsmasq.service is just a
quirk of my personal DNS configuration; others might depend on different or
non-local resolvers.

$ cat wg-reresolve-dns.service
[Unit]
Description=Reresolve DNS of all WireGuard endpoints that have missed a
handshake
Wants=network-online.target dnsmasq.service wg-quick@wgnet0.service
After=network-online.target dnsmasq.service wg-quick@wgnet0.service

[Service]
Type=oneshot
ExecStart=/bin/sh -c 'for i in /etc/wireguard/*.conf; do
/usr/share/doc/wireguard/examples/reresolve-dns/reresolve-dns.sh "$i"; done'

# Finally, here's an example of systemd units that use the more general
@.timer and @.service (but lack the unit dependencies):
https://gist.github.com/ephemient/45ffc8c143d3c4f3d1a940f4293e4b84


On Wed, Nov 27, 2019 at 04:31 Jason A. Donenfeld <Jason@zx2c4.com> wrote:

> Thanks for the suggestion!
>
>
> https://git.zx2c4.com/WireGuard/commit/?id=d05b6606886018853da20ca3ee8bda16524b53b9
>

[-- Attachment #1.2: Type: text/html, Size: 2883 bytes --]

[-- Attachment #2: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

      reply	other threads:[~2019-11-27 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 22:40 Conrad Meyer
2019-11-27 12:31 ` Jason A. Donenfeld
2019-11-27 18:23   ` Conrad Meyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG6CVpVzkmt++KR6A=gzGG_cDC9Pusw6LhwnVUBSwTgEkULhnQ@mail.gmail.com' \
    --to=cem@freebsd.org \
    --cc=Jason@zx2c4.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).