wg-quick: darwin: do not remove routes when no real interface

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-05-22 16:32:40 +02:00
parent 59dae33e9a
commit 52eb6a187c

View file

@ -107,6 +107,7 @@ add_if() {
}
del_routes() {
[[ -n $REAL_INTERFACE ]] || return 0
local todelete=( ) destination gateway netif
while read -r destination _ _ _ _ netif _; do
[[ $netif == "$REAL_INTERFACE" ]] && todelete+=( "$destination" )