]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg-quick: use printf -v instead of namerefs for bash 4.2
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 27 Jun 2017 20:18:13 +0000 (22:18 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 28 Jun 2017 03:28:54 +0000 (05:28 +0200)
I'm not happy about this.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/wg-quick.bash

index 6edcd3a434206addf49f7247bb17f147b45f2d09..243f35d337f4bc97e40d78c473982471eacec49a 100755 (executable)
@@ -54,10 +54,9 @@ parse_options() {
 }
 
 read_bool() {
-       local -n out="$1"
        case "$2" in
-       true) out=1 ;;
-       false) out=0 ;;
+       true) printf -v "$1" 1 ;;
+       false) printf -v "$1" 0 ;;
        *) die "\`$2' is neither true nor false"
        esac
 }