From a184e2cfdd0e8c80529340df759ef488675b932f Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Tue, 25 Apr 2023 08:30:38 +1000 Subject: [PATCH 1/5] Update CHANGES.txt --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index df2a5f8..e195749 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +v2.2.43 +- Fixed DSM 6 bug where the drives were being duplicated in the .db files each time the script was run. +- Fixed DSM 6 bug where the .db files were being duplicated as .dbr each time the db files were edited. + v2.2.42 - Fixed bug where expansion units ending in RP or II were not detected. - Added a --restore option to undo all changes made by the script. From e1f54a31d4f6d6a639405111ad946ccc4802a7fc Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Tue, 25 Apr 2023 08:31:56 +1000 Subject: [PATCH 2/5] Update syno_hdd_db.sh - Fixed DSM 6 bug where the drives were being duplicated in the .db files each time the script was run. - Fixed DSM 6 bug where the .db files were being duplicated as .dbr each time the db files were edited. --- syno_hdd_db.sh | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index cf0b986..bc3da1a 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -30,6 +30,11 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Fixed DSM 6 bug where the drives were being duplicated in the .db files each time the script was run. +# +# Fixed DSM 6 bug where the .db files were being duplicated as .dbr each time the db files were edited. +# +# # Fixed bug where expansion units ending in RP or II were not detected. # # Added a --restore option to undo all changes. @@ -138,7 +143,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v2.2.42" +scriptver="v2.2.43" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -838,14 +843,13 @@ updatedb() { #echo hdmodel "$hdmodel" >&2 # debug #echo fwrev "$fwrev" >&2 # debug - if grep "$hdmodel"'":{"'"$fwrev" "$2" >/dev/null; then - echo -e "${Yellow}$hdmodel${Off} already exists in ${Cyan}$(basename -- "$2")${Off}" >&2 - else - # Check if db file is new or old style - getdbtype "$2" + # Check if db file is new or old style + getdbtype "$2" - if [[ $dbtype -gt "6" ]]; then - # Don't need to add firmware version? + if [[ $dbtype -gt "6" ]]; then + if grep "$hdmodel"'":{"'"$fwrev" "$2" >/dev/null; then + echo -e "${Yellow}$hdmodel${Off} already exists in ${Cyan}$(basename -- "$2")${Off}" >&2 + else fwstrng=\"$fwrev\" fwstrng="$fwstrng":{\"compatibility_interval\":[{\"compatibility\":\"support\",\"not_yet_rolling_status\" fwstrng="$fwstrng":\"support\",\"fw_dsm_update_status_notify\":false,\"barebone_installable\":true}]}, @@ -869,8 +873,11 @@ updatedb() { #echo "Append drive and firmware:" # debug editdb7 "append" "$2" fi - - elif [[ $dbtype -eq "6" ]]; then + fi + elif [[ $dbtype -eq "6" ]]; then + if grep "$hdmodel" "$2" >/dev/null; then + echo -e "${Yellow}$hdmodel${Off} already exists in ${Cyan}$(basename -- "$2")${Off}" >&2 + else # example: # {"model":"WD60EFRX-68MYMN1","firmware":"82.00A82","rec_intvl":[1]}, # Don't need to add firmware version? @@ -880,7 +887,7 @@ updatedb() { startstring="{\"success\":1,\"list\":\[" # example: # {"success":1,"list":[{"model":"WD60EFRX-68MYMN1","firmware":"82.00A82","rec_intvl":[1]}, - if sed -ir "s/$startstring/$startstring$string/" "$2"; then + if sed -i "s/$startstring/$startstring$string/" "$2"; then echo -e "Added ${Yellow}$hdmodel${Off} to ${Cyan}$(basename -- "$2")${Off}" else echo -e "\n${Error}ERROR 8${Off} Failed to update $(basename -- "$2")${Off}" >&2 @@ -890,6 +897,7 @@ updatedb() { fi } + # HDDs and SATA SSDs num="0" while [[ $num -lt "${#hdds[@]}" ]]; do @@ -1100,7 +1108,7 @@ else #if [[ $url == "127.0.0.1" ]]; then if [[ $url ]]; then # Delete "drive_db_test_url=127.0.0.1" line (inc. line break) - sed -i "/drive_db_test_url=*/d" "/etc.defaults/synoinfo.conf" + sed -i "/drive_db_test_url=*/d" "$synoinfo" # Check if we re-enabled drive db auto updates url="$(get_key_value $synoinfo drive_db_test_url)" From 0b2455420ae42b84ce2e7fe208e4f6b71d98513d Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Tue, 25 Apr 2023 08:32:23 +1000 Subject: [PATCH 3/5] Update syno_hdd_db.sh - Fixed DSM 6 bug where the drives were being duplicated in the .db files each time the script was run. - Fixed DSM 6 bug where the .db files were being duplicated as .dbr each time the db files were edited. --- syno_hdd_db.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index bc3da1a..d903538 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -34,7 +34,6 @@ # # Fixed DSM 6 bug where the .db files were being duplicated as .dbr each time the db files were edited. # -# # Fixed bug where expansion units ending in RP or II were not detected. # # Added a --restore option to undo all changes. From 8b0037007f96460788120d6a98d430198ff5213e Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Tue, 25 Apr 2023 08:35:43 +1000 Subject: [PATCH 4/5] Update README.md Added --restore option --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e2b38fd..6357916 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ ### Options when running the script * If you run the script without --force or -f it will re-eanble "support_disk_compatibility". * --ram or -r to disable "support_memory_compatibility". * If you run the script without --ram or -r it will re-eanble "support_memory_compatibility". +* --restore to undo all the changes the script has made.

From e24f0e3da425a5dd974a2778bec6ab93bbe7894a Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Tue, 25 Apr 2023 08:39:44 +1000 Subject: [PATCH 5/5] Add --restore option Added info on --restore option --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6357916..426e00a 100644 --- a/README.md +++ b/README.md @@ -89,5 +89,6 @@ ### Running the script via SSH **Donators** -- A big thank you to Gummibando on reddit for their donation. +- Thank you to Gummibando on reddit for their donation. +- Thank you to the onimous donors.