Browse Source

Update syno_hdd_db.sh

pull/14/head
007revad 3 years ago
committed by GitHub
parent
commit
e0749b5443
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      syno_hdd_db.sh

16
syno_hdd_db.sh

@ -186,8 +186,20 @@ if [[ $dsm -gt "6" ]]; then
fi
# Get Synology model
model=$(find /var/lib/disk-compatibility -regextype egrep -regex ".*host(_v7)?\.db$" |\
cut -d"/" -f5 | cut -d"_" -f1 | uniq)
# This doesn't work for drives migrated from different model
#model=$(find /var/lib/disk-compatibility -regextype egrep -regex ".*host(_v7)?\.db$" |\
# cut -d"/" -f5 | cut -d"_" -f1 | uniq)
model=$(cat /proc/sys/kernel/syno_hw_version)
model=${model,,} # convert to lower case
# Check for dodgy characters after model number
if [[ $model =~ 'pv10-j'$ ]]; then # GitHub issue #10
model=${model%??????}+ # replace last 6 chars with +
elif [[ $model =~ '-j'$ ]]; then # GitHub issue #2
model=${model%??} # remove last 2 chars
fi
#------------------------------------------------------------------------------

Loading…
Cancel
Save