Browse Source

Update syno_hdd_db.sh

pull/425/head
007revad 12 months ago
parent
commit
051ba36f9b
  1. 41
      syno_hdd_db.sh

41
syno_hdd_db.sh

@ -29,7 +29,7 @@
# /var/packages/StorageManager/target/ui/storage_panel.js # /var/packages/StorageManager/target/ui/storage_panel.js
scriptver="v3.6.109" scriptver="v3.6.110"
script=Synology_HDD_db script=Synology_HDD_db
repo="007revad/Synology_HDD_db" repo="007revad/Synology_HDD_db"
scriptname=syno_hdd_db scriptname=syno_hdd_db
@ -1196,22 +1196,27 @@ fi
# Expansion units # Expansion units
# eSATA and InfiniBand ports both appear in syno_slot_mapping as: ebox_conected=$(synodisk --enum -t ebox)
# Esata port count: 1 if [[ $ebox_conected ]]; then
# Eunit port 1 - RX1214 # Only device tree models have syno_slot_mapping
# Only device tree models have syno_slot_mapping # eSATA and InfiniBand ports both appear in syno_slot_mapping as:
if which syno_slot_mapping >/dev/null; then # Esata port count: 1
eunitlist=($(syno_slot_mapping | grep 'Eunit port' | awk '{print $5}')) # Eunit port 1 - RX1214
else if which syno_slot_mapping >/dev/null; then
# Create new /var/log/diskprediction log to ensure newly connected ebox is in latest log # syno_slot_mapping does not find SAS eunits
# Otherwise the new /var/log/diskprediction log is only created a midnight. eunitlist=($(syno_slot_mapping | grep 'Eunit port' | awk '{print $5}'))
/usr/syno/bin/syno_disk_data_collector record fi
if [[ ${#eunitlist[@]} -eq "0" ]]; then
# Get list of connected expansion units (aka eunit/ebox) # Create new /var/log/diskprediction log to ensure newly connected ebox is in latest log
path="/var/log/diskprediction" # Otherwise the new /var/log/diskprediction log is only created a midnight.
# shellcheck disable=SC2012 /usr/syno/bin/syno_disk_data_collector record
file=$(ls $path | tail -n1)
eunitlist=($(grep -Eowi "([FRD]XD?[0-9]{3,4})(rp|ii|sas){0,2}" "$path/$file" | uniq)) # Get list of connected expansion units (aka eunit/ebox)
path="/var/log/diskprediction"
# shellcheck disable=SC2012
file=$(ls $path | tail -n1)
eunitlist=($(grep -Eowi "([FRD]XD?[0-9]{3,4})(rp|ii|sas){0,2}" "$path/$file" | uniq))
fi
fi fi
# Sort eunitlist array into new eunits array to remove duplicates # Sort eunitlist array into new eunits array to remove duplicates
@ -2291,7 +2296,7 @@ if [[ $arch == "x86_64" ]]; then
branch="main" branch="main"
file_url="https://raw.githubusercontent.com/${repo}/${branch}/bin/dhm_tool" file_url="https://raw.githubusercontent.com/${repo}/${branch}/bin/dhm_tool"
# install_binfile <file> <file-url> <destination> <chmod> <bundled-path> <hash> # 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" install_binfile dhm_tool "$file_url" /usr/syno/sbin/dhm_tool "755" bin/dhm_tool "$md5hash"
# Check dhm_tool updated # Check dhm_tool updated
dhm_version="$(dhm_tool --version | grep "Utility Version" | awk '{print $NF}')" dhm_version="$(dhm_tool --version | grep "Utility Version" | awk '{print $NF}')"

Loading…
Cancel
Save