mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
networks: Numeric sort of interfaces instead of lexical sort
This does not change the order of any of the current devices. Only device supported currently that has multiple interfaces is APU. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
parent
f1459c066f
commit
249f29cef6
@ -7,11 +7,10 @@ set -e
|
||||
# Creates network-manager connections.
|
||||
|
||||
function get-interfaces {
|
||||
# XXX: Sorting of interfaces is non-numeric
|
||||
WIRED_IFACES=$(nmcli --terse --fields type,device device | grep "^ethernet:" | cut -d: -f2 | sort)
|
||||
WIRED_IFACES=$(nmcli --terse --fields type,device device | grep "^ethernet:" | cut -d: -f2 | sort -V)
|
||||
NO_OF_WIRED_IFACES=$(echo $WIRED_IFACES | wc -w)
|
||||
|
||||
WIRELESS_IFACES=$(nmcli --terse --fields type,device device | grep "^wifi:" | cut -d: -f2 | sort)
|
||||
WIRELESS_IFACES=$(nmcli --terse --fields type,device device | grep "^wifi:" | cut -d: -f2 | sort -V)
|
||||
NO_OF_WIRELESS_IFACES=$(echo $WIRELESS_IFACES | wc -w)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user