Skip to content

Commit

Permalink
Merge pull request #359 from 007revad/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
007revad authored Sep 30, 2024
2 parents 6fd56d9 + 0109257 commit dbe7ace
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v3.5.102
- Changed to use a faster method of detecting if an expansion unit is connected, for models with the syno_slot_mapping command.
- Changed so XPE users using the hdddb addon don't need to reboot.

v3.5.101
- Changed to support "--restore --ssd=restore" to restore write_mostly when restoring all other changes. Issue #340
- When using --restore you can also use --ssd=restore, -e or --email
Expand Down
30 changes: 20 additions & 10 deletions syno_hdd_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# /var/packages/StorageManager/target/ui/storage_panel.js


scriptver="v3.5.101"
scriptver="v3.5.102"
script=Synology_HDD_db
repo="007revad/Synology_HDD_db"
scriptname=syno_hdd_db
Expand Down Expand Up @@ -1150,15 +1150,23 @@ fi


# Expansion units
# Create new /var/log/diskprediction log to ensure newly connected ebox is in latest log
# Otherwise the new /var/log/diskprediction log is only created a midnight.
/usr/syno/bin/syno_disk_data_collector record

# 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))
# eSATA and InfiniBand ports both appear in syno_slot_mapping as:
# Esata port count: 1
# Eunit port 1 - RX1214
# Only device tree models have syno_slot_mapping
if which syno_slot_mapping >/dev/null; then
eunitlist=($(syno_slot_mapping | grep 'Eunit port' | awk '{print $5}'))
else
# Create new /var/log/diskprediction log to ensure newly connected ebox is in latest log
# Otherwise the new /var/log/diskprediction log is only created a midnight.
/usr/syno/bin/syno_disk_data_collector record

# 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

# Sort eunitlist array into new eunits array to remove duplicates
if [[ ${#eunitlist[@]} -gt "0" ]]; then
Expand Down Expand Up @@ -2095,10 +2103,12 @@ if [[ $nodbupdate == "yes" ]]; then
# Add drive_db_test_url="127.0.0.1"
#echo 'drive_db_test_url="127.0.0.1"' >> "$synoinfo"
/usr/syno/bin/synosetkeyvalue "$synoinfo" "$dtu" "127.0.0.1"
[ -d /tmpRoot ] && /tmpRoot/usr/syno/bin/synosetkeyvalue /tmpRoot/etc.defaults/synoinfo.conf "$dtu" "127.0.0.1"
disabled="yes"
elif [[ $url != "127.0.0.1" ]]; then
# Edit drive_db_test_url=
/usr/syno/bin/synosetkeyvalue "$synoinfo" "$dtu" "127.0.0.1"
[ -d /tmpRoot ] && /tmpRoot/usr/syno/bin/synosetkeyvalue /tmpRoot/etc.defaults/synoinfo.conf "$dtu" "127.0.0.1"
disabled="yes"
fi

Expand Down

0 comments on commit dbe7ace

Please sign in to comment.