Browse Source

Update syno_hdd_db.sh

- Fixed bug where removable drives were being detected and added to drive database.
pull/14/head
007revad 3 years ago
committed by GitHub
parent
commit
0cca7b8620
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      syno_hdd_db.sh

24
syno_hdd_db.sh

@ -47,6 +47,8 @@
#
# Changed checking drive_db_test_url setting to be more durable.
#
# Fixed bug where removable drives were being detected and added to drive database.
#
#
# Added check that M.2 volume support is enabled (on supported models).
#
@ -263,15 +265,19 @@ fi
# Get list of installed SATA, SAS and M.2 NVMe/SATA drives
getdriveinfo() {
# Get drive model and firmware version
hdmodel=$(cat "$1/device/model")
hdmodel=$(printf "%s" "$hdmodel" | xargs) # trim leading and trailing white space
fwrev=$(cat "$1/device/rev")
fwrev=$(printf "%s" "$fwrev" | xargs) # trim leading and trailing white space
if [[ $hdmodel ]] && [[ $fwrev ]]; then
hdlist+=("${hdmodel},${fwrev}")
# Skip removable drives (USB drives)
removable=$(cat "$1/removable")
if [[ $removable == "0" ]]; then
# Get drive model and firmware version
hdmodel=$(cat "$1/device/model")
hdmodel=$(printf "%s" "$hdmodel" | xargs) # trim leading and trailing white space
fwrev=$(cat "$1/device/rev")
fwrev=$(printf "%s" "$fwrev" | xargs) # trim leading and trailing white space
if [[ $hdmodel ]] && [[ $fwrev ]]; then
hdlist+=("${hdmodel},${fwrev}")
fi
fi
}

Loading…
Cancel
Save