diff --git a/CHANGES.txt b/CHANGES.txt index 9363b15..4245934 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v1.2.17 +- Added disable support memory compatibility option --ram or -r + v1.2.16 - Changed to show the script version, Synology model and DSM version on each run to make it easier to debug any user's issues. diff --git a/README.md b/README.md index 1f70dc4..7d51b7c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ The script works in DSM 7 and DSM 6. * Adds any missing drives to the Synology's compatible-drive database. * Prevents DSM auto updating the drive database. * Optionally disable DSM's "support_disk_compatibility". +* Optionally disable DSM's "support_memory_compatibility". * Checks that M.2 volume support is enabled (on supported models). * Makes DSM recheck disk compatibility so rebooting is not needed (DSM 7 only). * Reminds you that you may need to reboot the Synology after running the script (DSM 6 only). @@ -38,11 +39,13 @@ You would need to re-run the script after a DSM update. If you have DSM set to a ### Options when running the script -There are 3 optional flags you can use when running the script: -* -showedits or -s to show you the changes it made to the Synology's compatible-drive database. -* -force or -f to disable "support_disk_compatibility". This should be needed if any of your drives weren't detected. - * If you run the script without -force or -f it will re-eanble "support_disk_compatibility". -* -m2 or -m to prevent processing M.2 drives. +There are 4 optional flags you can use when running the script: +* --showedits or -s to show you the changes it made to the Synology's compatible-drive database. +* --force or -f to disable "support_disk_compatibility". This should only be needed if any of your drives weren't detected. + * If you run the script without --force or -f it will re-eanble "support_disk_compatibility". +* --ram or -r to disable "support_memory_compatibility". + * If you run the script without --ram or -r it will re-eanble "support_memory_compatibility". +* --m2 or -m to prevent processing M.2 drives. ### Scheduling the script in Synology's Task Scheduler @@ -75,3 +78,4 @@ sudo /path-to-script/syno_hdd_db.sh -showedits - The idea for this script came from a comment made by Empyrealist on the Synology subreddit. - Thanks for the assistance from Alex_of_Chaos on the Synology subreddit. - Thanks to dwabraxus and aferende for help detecting connected expansion units. +- Thanks to bartoque on the Synology subreddit for the tip on making the script download the latest release from github. diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index a69b304..a1ca942 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -82,7 +82,7 @@ # Optionally disable "support_disk_compatibility". -scriptver="v1.2.16" +scriptver="v1.2.17" script=Synology_HDD_db repo="007revad/Synology_HDD_db" @@ -150,8 +150,7 @@ if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \ force=yes ;; -r|--ram) # Include memory compatibility - # shellcheck disable=SC2034 - ram=yes # for future use + ram=yes ;; -h|--help) # Show usage options usage @@ -688,6 +687,30 @@ else fi +# Optionally disable "support_memory_compatibility" +smc=support_memory_compatibility +setting="$(get_key_value $synoinfo $smc)" +if [[ $ram == "yes" ]]; then + if [[ $setting == "yes" ]]; then + # Disable support_memory_compatibility + sed -i "s/${smc}=\"yes\"/${smc}=\"no\"/" "$synoinfo" + setting="$(get_key_value "$synoinfo" $smc)" + if [[ $setting == "no" ]]; then + echo -e "\nDisabled support memory compatibility." + fi + fi +else + if [[ $setting == "no" ]]; then + # Enable support_memory_compatibility + sed -i "s/${smc}=\"no\"/${smc}=\"yes\"/" "$synoinfo" + setting="$(get_key_value "$synoinfo" $smc)" + if [[ $setting == "yes" ]]; then + echo -e "\nRe-enabled support memory compatibility." + fi + fi +fi + + # Enable m2 volume support if [[ $m2 != "no" ]]; then if [[ $m2exists == "yes" ]]; then