From aad502c217304f9eb00222822c99f29f039e2a15 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Tue, 23 Jan 2024 06:01:40 +1100 Subject: [PATCH] Update syno_hdd_db.sh - Fix for drives that exist in the drive database already but have "compatibility unverified". Issue #224 --- syno_hdd_db.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 76bca9b..bea4028 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -1114,9 +1114,6 @@ editdb7(){ #exit 6 fi fi - - # Edit existing drives in db with compatibility:unverified # Issue #224 - sed -i 's/unverified/support/g' "$2" } @@ -1163,6 +1160,14 @@ updatedb(){ editdb7 "append" "$2" fi fi + + # Edit existing drives in db with compatibility:unverified # Issue #224 + if grep 'unverified' "$2" >/dev/null; then + sed -i 's/unverified/support/g' "$2" + if ! grep 'unverified' "$2" >/dev/null; then + echo -e "Edited unverified drives in ${Cyan}$(basename -- "$2")${Off}" >&2 + fi + fi elif [[ $dbtype -eq "6" ]]; then if grep "$hdmodel" "$2" >/dev/null; then echo -e "${Yellow}$hdmodel${Off} already exists in ${Cyan}$(basename -- "$2")${Off}" >&2