From ca75ef2dbca4f1ebceb2bece9fb3bc726808e312 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Fri, 13 Feb 2026 09:20:05 +1100 Subject: [PATCH 1/5] Update CHANGES.txt for version 3.6.122 Added bug fixes for drive models and NVMe drives with multiple consecutive spaces. --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 88e1814..ff41c94 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +v3.6.122 +- Bug fix for drive models with multiple consecutive spaces in model name. Issue #559 +- Bug fix for nvme drives with multiple consecutive spaces in firmware version. + v3.6.121 - Added --reboot option to reboot the NAS after a DSM update where the build number has changed. - Only needed if NVMe volume or PCIe card need a 2nd reboot after DSM update. From b095f29ed77dbb61635c5f42534a26b922eccdf8 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Fri, 13 Feb 2026 09:20:50 +1100 Subject: [PATCH 2/5] Update script version and enhance whitespace handling Updated script version and improved whitespace trimming for drive model and firmware revision. --- syno_hdd_db.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 2bad69d..af48343 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,7 +29,7 @@ # /var/packages/StorageManager/target/ui/storage_panel.js -scriptver="v3.6.121" +scriptver="v3.6.122" script=Synology_HDD_db repo="007revad/Synology_HDD_db" scriptname=syno_hdd_db @@ -1026,7 +1026,8 @@ getdriveinfo(){ # Get drive model hdmodel=$(cat "$1/device/model") - hdmodel=$(printf "%s" "$hdmodel" | xargs) # trim leading and trailing white space + #hdmodel=$(printf "%s" "$hdmodel" | xargs) # trim leading and trailing white space (also replaces multiple spaces in model with 1 space) + hdmodel="$(printf "%s" "$hdmodel" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')" # trim leading and trailing white space # Fix dodgy model numbers fixdrivemodel "$hdmodel" @@ -1066,13 +1067,15 @@ getdriveinfo(){ getm2info(){ # $1 is /sys/block/nvme0n1 etc 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 (also replaces multiple spaces in model with 1 space) + nvmemodel="$(printf "%s" "$nvmemodel" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')" # trim leading and trailing white space if [[ $2 == "nvme" ]]; then nvmefw=$(cat "$1/device/firmware_rev") elif [[ $2 == "nvc" ]]; then nvmefw=$(cat "$1/device/rev") fi - nvmefw=$(printf "%s" "$nvmefw" | xargs) # trim leading and trailing white space + #nvmefw=$(printf "%s" "$nvmefw" | xargs) # trim leading and trailing white space (also replaces multiple spaces in model with 1 space) + nvmefw="$(printf "%s" "$nvmefw" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')" # trim leading and trailing white space # Get drive GB size size_gb=$(get_size_gb "$1") From 923533fb24c3172395366d2151b580b628e6950d Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sat, 14 Feb 2026 03:20:26 +1100 Subject: [PATCH 3/5] Fix options in getopt command --- syno_hdd_db.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index af48343..331f09b 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -116,8 +116,7 @@ args=("$@") # Check for flags with getopt if options="$(getopt -o SIabcdefghijklmnopqrstuvwxyz0123456789 -l \ - ssd:,ihm,restore,showedits,noupdate,nodbupdate,m2,force,\ - incompatible,ram,pcie,wdda,email,autoupdate:,reboot,help,version,debug \ + ssd:,ihm,restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,pcie,wdda,email,autoupdate:,reboot,help,version,debug -- "$@")"; then -- "$@")"; then eval set -- "$options" while true; do From ae78f33140c2e4549e4123f2f62795efa71245ce Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sat, 14 Feb 2026 18:03:12 +1100 Subject: [PATCH 4/5] Fix syntax error in getopt command --- syno_hdd_db.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 331f09b..bc33207 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -117,7 +117,6 @@ args=("$@") # Check for flags with getopt if options="$(getopt -o SIabcdefghijklmnopqrstuvwxyz0123456789 -l \ ssd:,ihm,restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,pcie,wdda,email,autoupdate:,reboot,help,version,debug -- "$@")"; then - -- "$@")"; then eval set -- "$options" while true; do case "$1" in From 6083dab02ee45c614dc0d3d618b9f1afeb541a50 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sat, 14 Feb 2026 18:18:58 +1100 Subject: [PATCH 5/5] Update for v3.6.122 --- CHANGES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.txt b/CHANGES.txt index ff41c94..3005bc8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,7 @@ v3.6.122 - Bug fix for drive models with multiple consecutive spaces in model name. Issue #559 - Bug fix for nvme drives with multiple consecutive spaces in firmware version. +- Bug fix for options not working. Issue #559 and #563 v3.6.121 - Added --reboot option to reboot the NAS after a DSM update where the build number has changed.