mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-23 22:29:54 +07:00
functions: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
0f64c0ed80
commit
4d47d4dfb3
@ -232,14 +232,14 @@ function _sort_netif() {
|
||||
local ETHLIST=""
|
||||
local ETHX="$(ls /sys/class/net/ 2>/dev/null | grep eth)" # real network cards list
|
||||
for ETH in ${ETHX}; do
|
||||
local MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g; s/.*/\L&/')"
|
||||
local MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g; s/.*/\L&/' | tr '[:lower:]' '[:upper:]')"
|
||||
local BUS="$(ethtool -i ${ETH} 2>/dev/null | grep bus-info | cut -d' ' -f2)"
|
||||
ETHLIST="${ETHLIST}${BUS} ${MAC} ${ETH}\n"
|
||||
done
|
||||
local ETHLISTTMPM=""
|
||||
local ETHLISTTMPB="$(echo -e "${ETHLIST}" | sort)"
|
||||
if [ -n "${1}" ]; then
|
||||
local MACS="$(echo "${1}" | sed 's/://g; s/,/ /g; s/.*/\L&/')"
|
||||
local MACS="$(echo "${1}" | sed 's/://g; s/,/ /g; s/.*/\L&/' | tr '[:lower:]' '[:upper:]')"
|
||||
for MACX in ${MACS}; do
|
||||
ETHLISTTMPM="${ETHLISTTMPM}$(echo -e "${ETHLISTTMPB}" | grep "${MACX}")\n"
|
||||
ETHLISTTMPB="$(echo -e "${ETHLISTTMPB}" | grep -v "${MACX}")\n"
|
||||
|
Loading…
Reference in New Issue
Block a user