From cc6d439928c956486b0b2400a11811a5fc78d2b3 Mon Sep 17 00:00:00 2001 From: kx1t <15090643+kx1t@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:59:28 -0400 Subject: [PATCH] fix device serial parsing --- rootfs/etc/templates/run | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/rootfs/etc/templates/run b/rootfs/etc/templates/run index 3555d52..1c93b0b 100755 --- a/rootfs/etc/templates/run +++ b/rootfs/etc/templates/run @@ -14,12 +14,7 @@ VDLM_BIN="/usr/local/bin/vdlm2dec" # shellcheck disable=SC2001 FREQ_STRING="" -mapfile -t RTL_TEST_OUTPUT < <(timeout 1s rtl_test -d 0 2>&1 | grep -P '^\s+\d+:\s.*?,.*?,\s+SN:\s+.*?$' | IFS=$'\n' sed -n 's/^\s*\([^:]*\):[^,]*,[^,]*,\s*SN:\s*\(.*\)$/\1,\2/; s/\s*$//p' || true) -for RTL_TEST_OUTPUT_LINE in "${RTL_TEST_OUTPUT[@]}"; do - if [[ "${RTL_TEST_OUTPUT_LINE##*,}" == "$SERIAL" ]]; then - DEVICE_ID="${RTL_TEST_OUTPUT_LINE%%,*}" - fi -done +DEVICE_ID="$(timeout 1s rtl_test -d $((RANDOM+99)) 2>&1 | grep -P -e "SN: $SERIAL" | sed -n 's/^\s*\([0-9]\+\):.*$/\1/p')" if [[ -z "${DEVICE_ID}" ]]; then echo "Could not find device ID for serial '$SERIAL'"