Browse Source

Update syno_hdd_db.sh

Fixed issue where drives weren't detected if NAS was updated from DSM 6 to DSM 7, and models like the DVA3219 using sata# even in DSM 6.
pull/15/head v1.0.1
007revad 3 years ago
committed by GitHub
parent
commit
045352a242
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      syno_hdd_db.sh

9
syno_hdd_db.sh

@ -51,9 +51,7 @@ fi
#------------------------------------------------------------------------------
# Get list of installed HDDs and SATA SSDs
if [[ $dsm -gt "6" ]]; then
# DSM 7 (sata drives, sata1, sata2 etc)
# for drive in /dev/sata[0-9]{1,2}; do
# SATA drives, sata1, sata2 etc
for drive in /dev/sata*; do
tmp=$(hdparm -i "$drive" | grep Model)
hdmodel=$(printf %s "$tmp" | cut -d"," -f 1 | cut -d"=" -f 2)
@ -62,8 +60,8 @@ if [[ $dsm -gt "6" ]]; then
hdparm+=("${hdmodel},${fwrev}")
fi
done
else
# DSM 6 (sata drives, sda, sdb etc)
# SATA drives, sda, sdb etc
for drive in /dev/sd[a-z]{1,2}; do
tmp=$(hdparm -i "$drive" | grep Model)
hdmodel=$(printf %s "$tmp" | cut -d"," -f 1 | cut -d"=" -f 2)
@ -72,7 +70,6 @@ else
hdparm+=("${hdmodel},${fwrev}")
fi
done
fi
# Sort hdparm array into new hdds array to remove duplicates
if [[ ${#hdparm[@]} -gt "0" ]]; then

Loading…
Cancel
Save