Browse Source

Update syno_hdd_db.sh

Fixed bug in re-enable drive db updates
pull/47/head
007revad 3 years ago
committed by GitHub
parent
commit
e67aa1657b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      syno_hdd_db.sh

16
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. # It's also parsed and checked and probably in some cases it could be more critical to patch that one instead.
# DONE # DONE
# Fixed bug in re-enable drive db updates
#
# Fixed "download new version" failing if script was run via symlink or ./<scriptname> # Fixed "download new version" failing if script was run via symlink or ./<scriptname>
# #
# Changed to show if no M.2 cards were found, if M.2 drives were found. # 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") #scriptpath=$(dirname -- "$0")
# Get script location # Get script location
# https://stackoverflow.com/questions/59895/
source=${BASH_SOURCE[0]} source=${BASH_SOURCE[0]}
while [ -L "$source" ]; do # Resolve $source until the file is no longer a symlink while [ -L "$source" ]; do # Resolve $source until the file is no longer a symlink
scriptpath=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd ) scriptpath=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )
@ -871,18 +874,23 @@ if [[ $nodbupdate == "yes" ]]; then
else else
echo -e "\n${Error}ERROR${Off} Failed to disable drive db auto updates!" echo -e "\n${Error}ERROR${Off} Failed to disable drive db auto updates!"
fi fi
else
echo -e "\nDrive db auto updates already disabled."
fi fi
else else
# Re-enable drive db updates # Re-enable drive db updates
if [[ $url == "127.0.0.1" ]]; then #if [[ $url == "127.0.0.1" ]]; then
# Edit drive_db_test_url= if [[ $url ]]; then
sed -z "s/drive_db_test_url=\"127\.0\.0\.1\"\n//" "$synoinfo" >/dev/null # Delete "drive_db_test_url=127.0.0.1" line (inc. line break)
#sed -i "s/drive_db_test_url=\"127\.0\.0\.1\"//" "$synoinfo" # works but leaves line feed #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 # Check if we re-enabled drive db auto updates
url="$(get_key_value $synoinfo drive_db_test_url)" url="$(get_key_value $synoinfo drive_db_test_url)"
if [[ $url != "127.0.0.1" ]]; then if [[ $url != "127.0.0.1" ]]; then
echo -e "\nRe-enabled drive db auto updates." echo -e "\nRe-enabled drive db auto updates."
else
echo -e "\n${Error}ERROR${Off} Failed to enable drive db auto updates!"
fi fi
else else
echo -e "\nDrive db auto updates already enabled." echo -e "\nDrive db auto updates already enabled."

Loading…
Cancel
Save