mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-04 14:43:01 +02:00
confd: sort interfaces according to length and name
A list of interfaces: x10 x9 x8 x7 x6 x5 x4 x1 x2 x3 should be sorted in order with x10 last. Using the common 'sort -n' would generate: x1 x10 x2 ... so we use version sort. This way we can ensure that the order of bridge ports is natural and what end users expect. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
committed by
Tobias Waldekranz
parent
7fd7a2e430
commit
120e87ac99
@@ -85,13 +85,13 @@ phys_ifaces=$(ip -d -j link show | jq -r '
|
||||
select(.link_type == "ether") |
|
||||
select(.group != "internal") |
|
||||
select(has("parentbus")) |
|
||||
.ifname')
|
||||
.ifname' | sort -V)
|
||||
ports=$(ip -d -j link show group port | jq -r '
|
||||
.[] |
|
||||
select(.link_type == "ether") |
|
||||
select(.group != "internal") |
|
||||
select(has("parentbus")) |
|
||||
.ifname')
|
||||
.ifname' | sort -V)
|
||||
ifaces=""
|
||||
for phy in $phys_ifaces; do
|
||||
found=""
|
||||
|
||||
Reference in New Issue
Block a user