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
1 changed files with 1 additions and 0 deletions

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" )