From e67aa1657ba84132cebfa8b3cab65868c82d5f82 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 30 Mar 2023 19:03:43 +1100 Subject: [PATCH 1/2] Update syno_hdd_db.sh Fixed bug in re-enable drive db updates --- syno_hdd_db.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 7d004d0..a168df4 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,6 +29,8 @@ # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead. # DONE +# Fixed bug in re-enable drive db updates +# # Fixed "download new version" failing if script was run via symlink or ./ # # Changed to show if no M.2 cards were found, if M.2 drives were found. @@ -250,6 +252,7 @@ shorttag="${tag:1}" #scriptpath=$(dirname -- "$0") # Get script location +# https://stackoverflow.com/questions/59895/ source=${BASH_SOURCE[0]} while [ -L "$source" ]; do # Resolve $source until the file is no longer a symlink scriptpath=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd ) @@ -871,18 +874,23 @@ if [[ $nodbupdate == "yes" ]]; then else echo -e "\n${Error}ERROR${Off} Failed to disable drive db auto updates!" fi + else + echo -e "\nDrive db auto updates already disabled." fi else # Re-enable drive db updates - if [[ $url == "127.0.0.1" ]]; then - # Edit drive_db_test_url= - sed -z "s/drive_db_test_url=\"127\.0\.0\.1\"\n//" "$synoinfo" >/dev/null - #sed -i "s/drive_db_test_url=\"127\.0\.0\.1\"//" "$synoinfo" # works but leaves line feed + #if [[ $url == "127.0.0.1" ]]; then + if [[ $url ]]; then + # Delete "drive_db_test_url=127.0.0.1" line (inc. line break) + #sed -i "/drive_db_test_url=\"127.0.0.1\"/d" "/etc.defaults/synoinfo.conf" + sed -i "/drive_db_test_url=*/d" "/etc.defaults/synoinfo.conf" # Check if we re-enabled drive db auto updates url="$(get_key_value $synoinfo drive_db_test_url)" if [[ $url != "127.0.0.1" ]]; then echo -e "\nRe-enabled drive db auto updates." + else + echo -e "\n${Error}ERROR${Off} Failed to enable drive db auto updates!" fi else echo -e "\nDrive db auto updates already enabled." From 55b55807bf977124e4ebc6014e635733660e9f0f Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu, 30 Mar 2023 19:04:51 +1100 Subject: [PATCH 2/2] Update CHANGES.txt --- CHANGES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.txt b/CHANGES.txt index 2194683..5eb71cd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,6 @@ v1.2.31 - Bug fix. The --noupdate option was coded as --nodbupdate. Now either will work. +- Bug fix. Re-enable drive db updates wasn't working in some instances. v1.2.30 - Fixed "download new version" failing if script was run via symlink or ./