functions: fix sortnetif for arc

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-10-25 20:15:58 +02:00
parent 5b40850fe0
commit ddd7e2ccef

View File

@ -236,11 +236,11 @@ function _sort_netif() {
ETHLIST="${ETHLIST}${BUS} ${MAC} ${ETH}\n" ETHLIST="${ETHLIST}${BUS} ${MAC} ${ETH}\n"
done done
local ETHLISTTMPB="$(echo -e "${ETHLIST}" | sort)" local ETHLISTTMPB="$(echo -e "${ETHLIST}" | sort)"
local ETHLIST="$(echo -e "${ETHLISTTMPM}" | grep -v '^$')" local ETHLIST="$(echo -e "${ETHLISTTMPB}" | grep -v '^$')"
local ETHSEQ="$(echo -e "${ETHLIST}" | awk '{print $3}' | sed 's/eth//g')" local ETHSEQ="$(echo -e "${ETHLIST}" | awk '{print $3}' | sed 's/eth//g')"
local ETHNUM="$(echo -e "${ETHLIST}" | wc -l)" local ETHNUM="$(echo -e "${ETHLIST}" | wc -l)"
# echo "${ETHSEQ}" # echo "${ETHSEQ}" >"/tmp/ethseq"
# sort # sort
if [ ! "${ETHSEQ}" = "$(seq 0 $((${ETHNUM:0} - 1)))" ]; then if [ ! "${ETHSEQ}" = "$(seq 0 $((${ETHNUM:0} - 1)))" ]; then
/etc/init.d/S41dhcpcd stop >/dev/null 2>&1 /etc/init.d/S41dhcpcd stop >/dev/null 2>&1