All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: wireguard@wut.to
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: making wireguard work on RHEL7/etc.
Date: Tue, 27 Jun 2017 21:59:07 +0200	[thread overview]
Message-ID: <20170627195904.GA14889@zx2c4.com> (raw)
In-Reply-To: <alpine.LRH.2.20.1706272042170.17486@bcny.fcbq.bet>

On Tue, Jun 27, 2017 at 08:43:30PM +0100, wireguard@wut.to wrote:
> GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)

Arg. Looks like namerefs were only added in bash 4.3. Annoying. The
fix looks something like this, but it's so ugly and bothers me:

diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick.bash
index 6edcd3a..5325f9d 100755
--- a/src/tools/wg-quick.bash
+++ b/src/tools/wg-quick.bash
@@ -54,10 +54,9 @@ parse_options() {
 }
 
 read_bool() {
-	local -n out="$1"
 	case "$2" in
-	true) out=1 ;;
-	false) out=0 ;;
+	true) eval "$1=1" ;;
+	false) eval "$1=0" ;;
 	*) die "\`$2' is neither true nor false"
 	esac
 }


Not sure whether or not I'll merge it yet.

  reply	other threads:[~2017-06-27 19:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-24 15:18 making wireguard work on RHEL7/etc wireguard
2017-06-26  8:07 ` Aaron Muir Hamilton
2017-06-26  8:19   ` wireguard
2017-06-26  9:04     ` Jason A. Donenfeld
2017-06-26  9:25       ` wireguard
2017-06-26  9:57         ` Jason A. Donenfeld
2017-06-26 10:47           ` Jason A. Donenfeld
2017-06-26 19:55             ` wireguard
2017-06-27 11:02               ` Jason A. Donenfeld
2017-06-26 20:45             ` wireguard
2017-06-27 11:05               ` Jason A. Donenfeld
2017-06-27 11:38                 ` wireguard
2017-06-27 19:23                   ` Jason A. Donenfeld
2017-06-27 19:43                     ` wireguard
2017-06-27 19:59                       ` Jason A. Donenfeld [this message]
2017-06-27 20:22                         ` Jason A. Donenfeld
2017-06-27 20:52                           ` Jason A. Donenfeld
2017-06-27 21:30                             ` wireguard
2017-06-27 22:09                               ` Jason A. Donenfeld
2017-06-27  5:35           ` Andrej Kacian
2017-06-27  7:25             ` wireguard
2017-06-27  9:39               ` Andrej Kacian
2017-06-27 11:08                 ` Jason A. Donenfeld
2018-04-05 15:08                   ` Daniel Kahn Gillmor
2018-04-05 16:15                     ` Daniel Kahn Gillmor

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=20170627195904.GA14889@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=wireguard@lists.zx2c4.com \
    --cc=wireguard@wut.to \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.