diff --git a/sortnetif/install.sh b/sortnetif/install.sh index 1b19afd..0bdba21 100755 --- a/sortnetif/install.sh +++ b/sortnetif/install.sh @@ -12,14 +12,14 @@ if [ "${1}" = "patches" ]; then ETHLIST="" ETHX="$(ls /sys/class/net/ 2>/dev/null | grep eth)" # real network cards list for ETH in ${ETHX}; do - MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:upper:]' '[:lower:]')" + MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g; s/.*/\L&/')" BUS="$(ethtool -i ${ETH} 2>/dev/null | grep bus-info | cut -d' ' -f2)" ETHLIST="${ETHLIST}${BUS} ${MAC} ${ETH}\n" done ETHLISTTMPM="" ETHLISTTMPB="$(echo -e "${ETHLIST}" | sort)" if [ -n "${2}" ]; then - MACS="$(echo "${2}" | sed 's/://g' | tr '[:upper:]' '[:lower:]' | tr ',' ' ')" + MACS="$(echo "${2}" | sed 's/://g; s/,/ /g; s/.*/\L&/')" for MACX in ${MACS}; do ETHLISTTMPM="${ETHLISTTMPM}$(echo -e "${ETHLISTTMPB}" | grep "${MACX}")\n" ETHLISTTMPB="$(echo -e "${ETHLISTTMPB}" | grep -v "${MACX}")\n"