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