From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Jason@zx2c4.com Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 828b1706 for ; Tue, 27 Jun 2017 19:42:43 +0000 (UTC) Received: from frisell.zx2c4.com (frisell.zx2c4.com [192.95.5.64]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id dfc4fc2b for ; Tue, 27 Jun 2017 19:42:43 +0000 (UTC) Date: Tue, 27 Jun 2017 21:59:07 +0200 From: "Jason A. Donenfeld" To: wireguard@wut.to Subject: Re: making wireguard work on RHEL7/etc. Message-ID: <20170627195904.GA14889@zx2c4.com> References: <20170627110530.GC3026@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: Cc: WireGuard mailing list List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.