Skip to content

Commit

Permalink
Update syno_hdd_db.sh
Browse files Browse the repository at this point in the history
v3.5.108
- Prevent error message if /tmpRoot exists but does not contain /usr/syno/bin/synosetkeyvalue and /etc.defaults/synoinfo.conf. Issue #411
  • Loading branch information
007revad authored Dec 29, 2024
1 parent c101af6 commit 6d975b2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 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.107"
scriptver="v3.5.108"
script=Synology_HDD_db
repo="007revad/Synology_HDD_db"
scriptname=syno_hdd_db
Expand Down Expand Up @@ -958,7 +958,7 @@ getdriveinfo(){
fwrev=$(/usr/syno/bin/syno_hdd_util --ssd_detect | grep "$device " | awk '{print $(NF-3)}') # GitHub issue #86, 87

# Get firmware version with smartctl if $fwrev null
# for M.2 SATA SSD and Github issue #407
# for M.2 SATA SSD and SAS drives. Github issue #407
if [[ -z $fwrev ]]; then
dev=/dev/"$(basename -- "$1")"
fwrev=$(smartctl -a -d ata -T permissive "$dev" | grep -i firmware | awk '{print $NF}')
Expand Down Expand Up @@ -2136,12 +2136,20 @@ 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"
# Junior boot
#[ -d /tmpRoot ] && /tmpRoot/usr/syno/bin/synosetkeyvalue /tmpRoot/etc.defaults/synoinfo.conf "$dtu" "127.0.0.1"
if [ -f /tmpRoot/usr/syno/bin/synosetkeyvalue ] && [ -f /tmpRoot/etc.defaults/synoinfo.conf ]; then
/tmpRoot/usr/syno/bin/synosetkeyvalue /tmpRoot/etc.defaults/synoinfo.conf "$dtu" "127.0.0.1"
fi
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"
# Junior boot
#[ -d /tmpRoot ] && /tmpRoot/usr/syno/bin/synosetkeyvalue /tmpRoot/etc.defaults/synoinfo.conf "$dtu" "127.0.0.1"
if [ -f /tmpRoot/usr/syno/bin/synosetkeyvalue ] && [ -f /tmpRoot/etc.defaults/synoinfo.conf ]; then
/tmpRoot/usr/syno/bin/synosetkeyvalue /tmpRoot/etc.defaults/synoinfo.conf "$dtu" "127.0.0.1"
fi
disabled="yes"
fi

Expand Down

0 comments on commit 6d975b2

Please sign in to comment.