From 4f6107f36011f9fe6e3fac04ce0edb62438356a4 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 20 Dec 2016 19:14:19 +0100 Subject: tools: allowed-ips is easier to parse with spaces instead of ", " --- contrib/examples/wg-config/wg-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/examples/wg-config/wg-config b/contrib/examples/wg-config/wg-config index f2272b3..d7ea38c 100755 --- a/contrib/examples/wg-config/wg-config +++ b/contrib/examples/wg-config/wg-config @@ -129,7 +129,7 @@ cmd_add() { done up_if if [[ $AUTO_ROUTE -eq 1 ]]; then - for i in $(wg show "$INTERFACE" allowed-ips | grep -Po '(?<=[\t ])[0-9.:/a-z]+(?<=,)?' | sort -nr -k 2 -t /); do + for i in $(wg show "$INTERFACE" allowed-ips | grep -Po '(?<=[\t ])[0-9.:/a-z]+' | sort -nr -k 2 -t /); do if ! add_default "$i" && [[ $(ip route get "$i") != *dev\ $INTERFACE\ * ]]; then add_route "$i" fi -- cgit v1.2.3-59-g8ed1b