common_run - Make BK7231 filename check case-insensitive

This commit is contained in:
Cossid
2022-12-09 12:22:31 -06:00
parent 5076d368a6
commit 90fbe3060d

View File

@@ -17,8 +17,8 @@ rm -f profile.txt
if ! [ -z "${FIRMWARE}" ]; then
LOCAL_PROFILE=$(echo "${PROFILE}" | sed 's/\/work\///g')
CHIP=$(cat "${LOCAL_PROFILE}" | grep -o '"chip": "[^"]*' | grep -o '[^"]*$')
if grep -q "BK7231" <<< "${FIRMWARE}"; then
if ! grep -q "${CHIP}" <<< "${FIRMWARE}"; then
if grep -iq "BK7231" <<< "${FIRMWARE}"; then
if ! grep -iq "${CHIP}" <<< "${FIRMWARE}"; then
echo "WARNING: Flashing a firmware for the wrong chip may soft-brick your device requiring a serial flash to recover."
echo "You have selected a profile for chip type ${CHIP} but the selected firmware filename (${FIRMWARE}) indicates it may be for another chip."
read -p "Are you sure want to proceed? Type 'PROCEED' (case-sensitive) to continue or 'exit' to stop (exit/PROCEED): " doublecheck