From 2c1bab86020cac253f74e1cf54e9f8f08e519e47 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Thu, 27 Jun 2024 19:48:05 +0200 Subject: [PATCH] boot: rewrite mac related Signed-off-by: AuxXxilium --- files/initrd/opt/arc/boot.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/files/initrd/opt/arc/boot.sh b/files/initrd/opt/arc/boot.sh index 2734958f3..f94468026 100755 --- a/files/initrd/opt/arc/boot.sh +++ b/files/initrd/opt/arc/boot.sh @@ -165,11 +165,9 @@ for ETH in ${ETHX}; do MAC="$(readConfigKey "arc.${ETH}" "${USER_CONFIG_FILE}")" [ -z "${MAC}" ] && MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:upper:]' '[:lower:]')" ETHN=$((${ETHN} + 1)) - if [ ${ETHN} -le ${NICPORTS} ]; then - CMDLINE['mac${ETHN}']="${MAC}" - fi + [ ${ETHN} -le ${NICPORTS} ] && CMDLINE['mac${ETHN}']="${MAC}" done -CMDLINE['netif_num']="${NICPORTS}" +[ ${ETHN} -le ${NICPORTS} ] && CMDLINE['netif_num']="${ETHN}" || CMDLINE['netif_num']="${NICPORTS}" # Read user network settings while IFS=': ' read -r KEY VALUE; do