diff --git a/CHANGES.txt b/CHANGES.txt index ab25054..e9502f3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,10 @@ +v3.4.83 +- Fix for drives that exist in the drive database already but have "compatibility not_support". + - Affected drives were showing as "Incompatible" in storage manager. + v3.4.82 - Fix for drives that exist in the drive database already but have "compatibility unverified". Issue #224 + - Affected drives were showing as "Unverified" in storage manager. v3.4.81 - Bug fix for false "This script is NOT running on a Synology NAS!" if uname is installed from Entware. Issue #218 diff --git a/README.md b/README.md index 0bc45dc..bea079f 100644 --- a/README.md +++ b/README.md @@ -58,22 +58,24 @@ ### Options when running the script There are optional flags you can use when running the script: ```YAML - -s, --showedits Show edits made to _host db and db.new file(s). - -n, --noupdate Prevent DSM updating the compatible drive databases. + -s, --showedits Show edits made to _host db and db.new file(s) + -n, --noupdate Prevent DSM updating the compatible drive databases -r, --ram Disable memory compatibility checking (DSM 7.x only) - and sets max memory to the amount of installed memory. + and sets max memory to the amount of installed memory + -f, --force Force DSM to not check drive compatibility + Do not use this option unless absolutely needed + -i, --incompatible Change incompatible drives to supported + Do not use this option unless absolutely needed -w, --wdda Disable WD Device Analytics to prevent DSM showing - a false warning for WD drives that are 3 years old. - DSM 7.2.1 already has WDDA disabled. - -f, --force Force DSM to not check drive compatibility. - Do not use this option unless absolutely needed. - -e, --email Disable colored text in output scheduler emails. - --restore Undo all changes made by the script. - --autoupdate=AGE Auto update script (useful when script is scheduled). + a false warning for WD drives that are 3 years old + DSM 7.2.1 already has WDDA disabled + -e, --email Disable colored text in output scheduler emails + --restore Undo all changes made by the script + --autoupdate=AGE Auto update script (useful when script is scheduled) AGE is how many days old a release must be before - auto-updating. AGE must be a number: 0 or greater. - -h, --help Show this help message. - -v, --version Show the script version. + auto-updating. AGE must be a number: 0 or greater + -h, --help Show this help message + -v, --version Show the script version ``` **Notes:** diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 4819451..a65d735 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -27,7 +27,7 @@ # Now warns if script is located on an M.2 volume. -scriptver="v3.4.82" +scriptver="v3.4.83" script=Synology_HDD_db repo="007revad/Synology_HDD_db" scriptname=syno_hdd_db @@ -62,11 +62,13 @@ Options: -n, --noupdate Prevent DSM updating the compatible drive databases -r, --ram Disable memory compatibility checking (DSM 7.x only) and sets max memory to the amount of installed memory + -f, --force Force DSM to not check drive compatibility + Do not use this option unless absolutely needed + -i, --incompatible Change incompatible drives to supported + Do not use this option unless absolutely needed -w, --wdda Disable WD Device Analytics to prevent DSM showing a false warning for WD drives that are 3 years old DSM 7.2.1 already has WDDA disabled - -f, --force Force DSM to not check drive compatibility - Do not use this option unless absolutely needed -e, --email Disable colored text in output scheduler emails --restore Undo all changes made by the script --autoupdate=AGE Auto update script (useful when script is scheduled) @@ -96,7 +98,7 @@ args=("$@") # Check for flags with getopt if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -l \ - restore,showedits,noupdate,nodbupdate,m2,force,ram,wdda,immutable,email,autoupdate:,help,version,debug \ + restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,wdda,email,autoupdate:,help,version,debug \ -- "$@")"; then eval set -- "$options" while true; do @@ -117,6 +119,9 @@ if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -l \ -f|--force) # Disable "support_disk_compatibility" force=yes ;; + -i|--incompatible) # Change incompatible drives to supported + incompatible=yes + ;; -r|--ram) # Disable "support_memory_compatibility" ram=yes ;; @@ -1168,6 +1173,16 @@ updatedb(){ echo -e "Edited unverified drives in ${Cyan}$(basename -- "$2")${Off}" >&2 fi fi + + # Edit existing drives in db with compatibility:not_support + if [[ $incompatible == "yes" ]]; then + if grep 'not_support' "$2" >/dev/null; then + sed -i 's/not_support/support/g' "$2" + if ! grep 'not_support' "$2" >/dev/null; then + echo -e "Edited incompatible drives in ${Cyan}$(basename -- "$2")${Off}" >&2 + fi + 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