wg-quick: dumber matching for default routes
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
31d8ebcd2a
commit
5536e6de46
|
@ -152,7 +152,7 @@ add_route() {
|
||||||
|
|
||||||
if [[ -n $TABLE && $TABLE != auto ]]; then
|
if [[ -n $TABLE && $TABLE != auto ]]; then
|
||||||
cmd ip route add "$1" dev "$INTERFACE" table "$TABLE"
|
cmd ip route add "$1" dev "$INTERFACE" table "$TABLE"
|
||||||
elif [[ $1 == 0.0.0.0/0 || $1 =~ ^[0:]+/0$ ]]; then
|
elif [[ $1 == */0 ]]; then
|
||||||
add_default "$1"
|
add_default "$1"
|
||||||
else
|
else
|
||||||
[[ $(ip route get "$i" 2>/dev/null) == *dev\ $INTERFACE\ * ]] || cmd ip route add "$1" dev "$INTERFACE"
|
[[ $(ip route get "$i" 2>/dev/null) == *dev\ $INTERFACE\ * ]] || cmd ip route add "$1" dev "$INTERFACE"
|
||||||
|
|
Loading…
Reference in New Issue