|
|
@ -1,28 +1,4 @@ |
|
|
#!/usr/bin/env bash |
|
|
#!/usr/bin/env bash |
|
|
|
|
|
|
|
|
TEST_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 <model>" 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 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# shellcheck disable=SC1083,SC2054,SC2121,SC2207 |
|
|
# shellcheck disable=SC1083,SC2054,SC2121,SC2207 |
|
|
#-------------------------------------------------------------------------------------------------- |
|
|
#-------------------------------------------------------------------------------------------------- |
|
|
# Github: https://github.com/007revad/Synology_HDD_db |
|
|
# Github: https://github.com/007revad/Synology_HDD_db |
|
|
@ -751,19 +727,13 @@ fi |
|
|
# PCIe M.2 cards and connected Expansion Units. |
|
|
# PCIe M.2 cards and connected Expansion Units. |
|
|
|
|
|
|
|
|
fixdrivemodel(){ |
|
|
fixdrivemodel(){ |
|
|
# Remove " 00Y" from end of Samsung/Lenovo SSDs # Github issue #13 |
|
|
|
|
|
if [[ $1 =~ MZ.*" 00Y" ]]; then |
|
|
if [[ $1 =~ MZ.*" 00Y" ]]; then |
|
|
hdmodel=$(printf "%s" "$1" | sed 's/ 00Y.*//') |
|
|
hdmodel=$(printf "%s" "$1" | sed 's/ 00Y.*//') |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# Brands that return "BRAND <model>" and need "BRAND " removed. |
|
|
|
|
|
if [[ $1 =~ ^[A-Za-z]{1,7}" ".* ]]; then |
|
|
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#"WDC "} # Remove "WDC " from start of model name |
|
|
hdmodel=${hdmodel#"HGST "} # Remove "HGST " 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 |
|
|
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#"Hitachi "} # Remove "Hitachi " from start of model name |
|
|
hdmodel=${hdmodel#"SAMSUNG "} # Remove "SAMSUNG " 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#"FUJISTU "} # Remove "FUJISTU " from start of model name |
|
|
|