From b5914a4fdc4612f41dd5fcc799e711bc3af263ea Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Fri, 17 Nov 2023 18:51:23 +1100 Subject: [PATCH] Update syno_hdd_db.sh --- syno_hdd_db.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index bb906c5..da6fa49 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -726,6 +726,26 @@ fi # Get list of installed SATA, SAS and M.2 NVMe/SATA drives, # PCIe M.2 cards and connected Expansion Units. +fixdrivemodel(){ + # Remove " 00Y" from end of Samsung/Lenovo SSDs # Github issue #13 + if [[ $1 =~ MZ.*" 00Y" ]]; then + hdmodel=$(printf "%s" "$1" | sed 's/ 00Y.*//') + fi + + # Brands that return "BRAND " and need "BRAND " removed. + if [[ $1 =~ ^[A-Za-z]{1,7}" ".* ]]; then + # See Smartmontools database in /var/lib/smartmontools/drivedb.db + hdmodel=${hdmodel#"WDC "} # Remove "WDC " from start of model name + hdmodel=${hdmodel#"HGST "} # Remove "HGST " from start of model name + hdmodel=${hdmodel#"TOSHIBA "} # Remove "TOSHIBA " from start of model name + + # Old drive brands + hdmodel=${hdmodel#"Hitachi "} # Remove "Hitachi " from start of model name + hdmodel=${hdmodel#"SAMSUNG "} # Remove "SAMSUNG " from start of model name + hdmodel=${hdmodel#"FUJISTU "} # Remove "FUJISTU " from start of model name + hdmodel=${hdmodel#"APPLE HDD "} # Remove "APPLE HDD " from start of model name + fi +} getdriveinfo(){ # $1 is /sys/block/sata1 etc