From e4977afadd051f14befcf42d0b0c5c87f970980f Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Tue, 31 Dec 2024 15:55:37 +1100 Subject: [PATCH] Update syno_hdd_db.sh - Installs IronWolf Health Management on '22 series and newer models that don't have IronWolf Health Management (untested). --- syno_hdd_db.sh | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index a7d5f60..8d8347c 100755 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -2265,30 +2265,40 @@ if [[ $platform_name == "x86_64" ]]; then echo -e "\nSupport IronWolf Health Management already enabled." fi - # Check if dhm_tool needs updating - dhm_version="$(dhm_tool --version | grep "Utility Version" | awk '{print $NF}')" - if ! printf "%s\n%s\n" "2.5.1" "$dhm_version" | - sort --check=quiet --version-sort >/dev/null ; then - - # Backup existing dhm_tool - backupdb "/usr/syno/sbin/dhm_tool" - - # Update dhm_tool + if [[ ! -f /usr/syno/sbin/dhm_tool ]]; then + # Install dhm_tool on models without it ('22 series and newer) + # Untested md5hash="cf67c1d5006913297f85ca7f9d1795ba" branch="main" file_url="https://raw.githubusercontent.com/${repo}/${branch}/bin/dhm_tool" # install_binfile install_binfile dhm_tool "$file_url" /usr/syno/sbin/dhm_tool "a+x" bin/dhm_tool "$md5hash" - - # Check dhm_tool updated + else + # Check if dhm_tool needs updating dhm_version="$(dhm_tool --version | grep "Utility Version" | awk '{print $NF}')" - if [[ $dhm_version == "2.5.1" ]]; then - echo "Updated IronWolf Health Management." + if ! printf "%s\n%s\n" "2.5.1" "$dhm_version" | + sort --check=quiet --version-sort >/dev/null ; then + + # Backup existing dhm_tool + backupdb "/usr/syno/sbin/dhm_tool" + + # Update dhm_tool + md5hash="cf67c1d5006913297f85ca7f9d1795ba" + branch="main" + file_url="https://raw.githubusercontent.com/${repo}/${branch}/bin/dhm_tool" + # install_binfile + install_binfile dhm_tool "$file_url" /usr/syno/sbin/dhm_tool "a+x" bin/dhm_tool "$md5hash" + + # Check dhm_tool updated + dhm_version="$(dhm_tool --version | grep "Utility Version" | awk '{print $NF}')" + if [[ $dhm_version == "2.5.1" ]]; then + echo "Updated IronWolf Health Management." + else + echo "${Error}ERROR${Off} Failed to update IronWolf Health Management!" + fi else - echo "${Error}ERROR${Off} Failed to update IronWolf Health Management!" + echo "IronWolf Health Management already updated." fi - else - echo "IronWolf Health Management already updated." fi fi fi