Browse Source

Update syno_hdd_db.sh

test
007revad 3 years ago
committed by GitHub
parent
commit
77b0ba0feb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      syno_hdd_db.sh

8
syno_hdd_db.sh

@ -344,6 +344,7 @@ fixdrivemodel(){
getdriveinfo() { getdriveinfo() {
# Skip removable drives (USB drives) # Skip removable drives (USB drives)
# $1 is /sys/block/sata1 etc
removable=$(cat "$1/removable") # Some DSM 7 RS models return 1 for internal drives! removable=$(cat "$1/removable") # Some DSM 7 RS models return 1 for internal drives!
if [[ $removable == "0" ]] || [[ $dsm -gt "6" ]]; then if [[ $removable == "0" ]] || [[ $dsm -gt "6" ]]; then
# Get drive model and firmware version # Get drive model and firmware version
@ -363,6 +364,7 @@ getdriveinfo() {
} }
getm2info() { getm2info() {
# $1 is /sys/block/nvme0n1 etc
nvmemodel=$(cat "$1/device/model") nvmemodel=$(cat "$1/device/model")
nvmemodel=$(printf "%s" "$nvmemodel" | xargs) # trim leading and trailing white space nvmemodel=$(printf "%s" "$nvmemodel" | xargs) # trim leading and trailing white space
if [[ $2 == "nvme" ]]; then if [[ $2 == "nvme" ]]; then
@ -379,6 +381,7 @@ getm2info() {
getcardmodel() { getcardmodel() {
# Get M.2 card model (if M.2 drives found) # Get M.2 card model (if M.2 drives found)
# $1 is /dev/nvme0n1 etc
if [[ $debug == "yes" ]]; then echo "debug 2: getcardmodel"; fi # debug if [[ $debug == "yes" ]]; then echo "debug 2: getcardmodel"; fi # debug
@ -413,6 +416,7 @@ getcardmodel() {
for d in /sys/block/*; do for d in /sys/block/*; do
# $d is /sys/block/sata1 etc
case "$(basename -- "${d}")" in case "$(basename -- "${d}")" in
sd*|hd*) sd*|hd*)
if [[ $d =~ [hs]d[a-z][a-z]?$ ]]; then if [[ $d =~ [hs]d[a-z][a-z]?$ ]]; then
@ -434,7 +438,7 @@ for d in /sys/block/*; do
if [[ $debug == "yes" ]]; then echo "debug 1: $d nvme"; fi # debug if [[ $debug == "yes" ]]; then echo "debug 1: $d nvme"; fi # debug
getcardmodel "/dev/$d" getcardmodel "/dev/$(basename -- "${d}")"
fi fi
fi fi
;; ;;
@ -447,7 +451,7 @@ for d in /sys/block/*; do
if [[ $debug == "yes" ]]; then echo "debug 1: $d SATA M.2 "; fi # debug if [[ $debug == "yes" ]]; then echo "debug 1: $d SATA M.2 "; fi # debug
getcardmodel "/dev/$d" getcardmodel "/dev/$(basename -- "${d}")"
fi fi
fi fi
;; ;;

Loading…
Cancel
Save