If multiple default routes exist take the first.
This commit is contained in:
parent
8d2e090c81
commit
f103af50f6
1 changed files with 2 additions and 1 deletions
3
net
3
net
|
@ -11,7 +11,8 @@ randstr() {
|
|||
}
|
||||
|
||||
default_route() {
|
||||
ip route | grep '^default' | sed -n 's/.*dev \([^ ]*\).*/\1/p'
|
||||
ip route | awk '/^default/ && (NR==1) {print $5}'
|
||||
|
||||
}
|
||||
|
||||
find_next_subnet() {
|
||||
|
|
Loading…
Add table
Reference in a new issue