Browse Source

Update syno_hdd_db.sh

- Installs IronWolf Health Management on '22 series and newer models that don't have IronWolf Health Management (untested).
pull/414/head
Dave Russell 12 months ago
committed by GitHub
parent
commit
e4977afadd
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 42
      syno_hdd_db.sh

42
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 <file> <file-url> <destination> <chmod> <bundled-path> <hash>
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 <file> <file-url> <destination> <chmod> <bundled-path> <hash>
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

Loading…
Cancel
Save