diff --git a/CHANGES.txt b/CHANGES.txt index b123cd2..36569d1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,8 @@ +v1.2.21 +- Reinstated removing brand from start of drive model to fix issue #24. + v1.2.20 -- Added a timeouts when checking for newer script version in case github is down or slow. +- Added a timeouts when checking for newer script version in case github is down or slow to fix issue #25. - Fixed change log (v1.2.19 and v1.2.18 were listed as v2.2.19 and v2.2.19). v1.2.19 diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 38c580b..99fffe7 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -86,7 +86,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.20" +scriptver="v1.2.21" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -296,6 +296,20 @@ fixdrivemodel(){ 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() {