Browse Source

Merge pull request #229 from 007revad/develop

Develop
pull/269/head v3.4.83
Dave Russell 2 years ago
committed by GitHub
parent
commit
fb85690a3e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      CHANGES.txt
  2. 28
      README.md
  3. 23
      syno_hdd_db.sh

5
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 v3.4.82
- Fix for drives that exist in the drive database already but have "compatibility unverified". Issue #224 - 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 v3.4.81
- Bug fix for false "This script is NOT running on a Synology NAS!" if uname is installed from Entware. Issue #218 - Bug fix for false "This script is NOT running on a Synology NAS!" if uname is installed from Entware. Issue #218

28
README.md

@ -58,22 +58,24 @@ ### Options when running the script <a name="options"></a>
There are optional flags you can use when running the script: There are optional flags you can use when running the script:
```YAML ```YAML
-s, --showedits Show edits made to <model>_host db and db.new file(s). -s, --showedits Show edits made to <model>_host db and db.new file(s)
-n, --noupdate Prevent DSM updating the compatible drive databases. -n, --noupdate Prevent DSM updating the compatible drive databases
-r, --ram Disable memory compatibility checking (DSM 7.x only) -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 -w, --wdda Disable WD Device Analytics to prevent DSM showing
a false warning for WD drives that are 3 years old. a false warning for WD drives that are 3 years old
DSM 7.2.1 already has WDDA disabled. DSM 7.2.1 already has WDDA disabled
-f, --force Force DSM to not check drive compatibility. -e, --email Disable colored text in output scheduler emails
Do not use this option unless absolutely needed. --restore Undo all changes made by the script
-e, --email Disable colored text in output scheduler emails. --autoupdate=AGE Auto update script (useful when script is scheduled)
--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 AGE is how many days old a release must be before
auto-updating. AGE must be a number: 0 or greater. auto-updating. AGE must be a number: 0 or greater
-h, --help Show this help message. -h, --help Show this help message
-v, --version Show the script version. -v, --version Show the script version
``` ```
**Notes:** **Notes:**

23
syno_hdd_db.sh

@ -27,7 +27,7 @@
# Now warns if script is located on an M.2 volume. # Now warns if script is located on an M.2 volume.
scriptver="v3.4.82" scriptver="v3.4.83"
script=Synology_HDD_db script=Synology_HDD_db
repo="007revad/Synology_HDD_db" repo="007revad/Synology_HDD_db"
scriptname=syno_hdd_db scriptname=syno_hdd_db
@ -62,11 +62,13 @@ Options:
-n, --noupdate Prevent DSM updating the compatible drive databases -n, --noupdate Prevent DSM updating the compatible drive databases
-r, --ram Disable memory compatibility checking (DSM 7.x only) -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 -w, --wdda Disable WD Device Analytics to prevent DSM showing
a false warning for WD drives that are 3 years old a false warning for WD drives that are 3 years old
DSM 7.2.1 already has WDDA disabled 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 -e, --email Disable colored text in output scheduler emails
--restore Undo all changes made by the script --restore Undo all changes made by the script
--autoupdate=AGE Auto update script (useful when script is scheduled) --autoupdate=AGE Auto update script (useful when script is scheduled)
@ -96,7 +98,7 @@ args=("$@")
# Check for flags with getopt # Check for flags with getopt
if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -l \ 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 -- "$@")"; then
eval set -- "$options" eval set -- "$options"
while true; do while true; do
@ -117,6 +119,9 @@ if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -l \
-f|--force) # Disable "support_disk_compatibility" -f|--force) # Disable "support_disk_compatibility"
force=yes force=yes
;; ;;
-i|--incompatible) # Change incompatible drives to supported
incompatible=yes
;;
-r|--ram) # Disable "support_memory_compatibility" -r|--ram) # Disable "support_memory_compatibility"
ram=yes ram=yes
;; ;;
@ -1168,6 +1173,16 @@ updatedb(){
echo -e "Edited unverified drives in ${Cyan}$(basename -- "$2")${Off}" >&2 echo -e "Edited unverified drives in ${Cyan}$(basename -- "$2")${Off}" >&2
fi fi
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 elif [[ $dbtype -eq "6" ]]; then
if grep "$hdmodel" "$2" >/dev/null; then if grep "$hdmodel" "$2" >/dev/null; then
echo -e "${Yellow}$hdmodel${Off} already exists in ${Cyan}$(basename -- "$2")${Off}" >&2 echo -e "${Yellow}$hdmodel${Off} already exists in ${Cyan}$(basename -- "$2")${Off}" >&2

Loading…
Cancel
Save