mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
BIOS_CHECKER: fixed correct BIOS file existence check and hash validation logic for multiple paths/hashes
This commit is contained in:
parent
7270014320
commit
363f007fbf
|
@ -1066,17 +1066,21 @@ configurator_check_bios_files() {
|
|||
|
||||
# Skip if bios_file is empty
|
||||
if [[ ! -z "$bios_file" ]]; then
|
||||
bios_file_found="No"
|
||||
bios_file_found="Yes"
|
||||
bios_md5_matched="No"
|
||||
|
||||
# Check if the BIOS file exists
|
||||
if [[ -f "$bios_folder/$bios_paths$bios_file" ]]; then
|
||||
bios_file_found="Yes"
|
||||
IFS=', ' read -r -a paths_array <<< "$bios_paths"
|
||||
for path in "${paths_array[@]}"; do
|
||||
if [[ ! -f "$bios_folder/$path/$bios_file" ]]; then
|
||||
bios_file_found="No"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if the hash matches any of the possible MD5s
|
||||
if [[ $bios_file_found == "Yes" ]]; then
|
||||
IFS=', ' read -r -a md5_array <<< "$bios_md5"
|
||||
for md5 in "${md5_array[@]}"; do
|
||||
if [[ $(md5sum "$bios_folder/$bios_paths$bios_file" | awk '{ print $1 }') == "$md5" ]]; then
|
||||
if [[ $(md5sum "$bios_folder/$path/$bios_file" | awk '{ print $1 }') == "$md5" ]]; then
|
||||
bios_md5_matched="Yes"
|
||||
break
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue