Skip to content

Commit

Permalink
Merge pull request #336 from 007revad/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
007revad authored Jul 29, 2024
2 parents 8463da2 + bfe8204 commit 03bc2b4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v3.5.97
- Changed silently skip empty .db.new files with showing an error. Issue #175
- Changed to warn if db file is 0 bytes.

v3.5.96
- Added option to set write_mostly for your internal HDDs so DSM will normally read from your faster internal SSD(s).
- It can automatically set DSM to read from your internal SSDs.
Expand Down
19 changes: 12 additions & 7 deletions syno_hdd_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# /var/packages/StorageManager/target/ui/storage_panel.js


scriptver="v3.5.96"
scriptver="v3.5.97"
script=Synology_HDD_db
repo="007revad/Synology_HDD_db"
scriptname=syno_hdd_db
Expand Down Expand Up @@ -74,11 +74,10 @@ Options:
-p, --pcie Enable creating volumes on M2 in unknown PCIe adaptor
-e, --email Disable colored text in output scheduler emails
-S, --ssd=DRIVE Enable write_mostly on internal HDDs so DSM primary
reads from internal SSDs or your specified drives.
-S automatically sets internal SSDs as DSM default
reads from internal SSDs or your specified drives
-S automatically sets internal SSDs as DSM preferred
--ssd=DRIVE requires the fast drive(s) as argument,
or restore as the argument to set drives to default
--ssd=sata1 or --ssd=sata1,sata2 or --ssd=sda etc
or restore as the argument to reset drives to default
--ssd=sata1 or --ssd=sata1,sata2 or --ssd=sda etc
--ssd=restore
--restore Undo all changes made by the script (except -S --ssd)
Expand Down Expand Up @@ -1156,8 +1155,14 @@ getdbtype(){
elif grep -q -F '{"success":1,"list":[' "$1"; then
# DSM 6 drive db files start with {"success":1,"list":[
dbtype=6
elif [[ ! $1 =~ .*'.db.new' ]]; then
if [[ $(stat -c%s "$1") -eq "0" ]]; then
echo -e "${Error}ERROR${Off} $(basename -- "${1}") is 0 bytes!" >&2
else
echo -e "${Error}ERROR${Off} Unknown database type $(basename -- "${1}")!" >&2
fi
dbtype=1
else
echo -e "${Error}ERROR${Off} Unknown database type $(basename -- "${1}")!" >&2
dbtype=1
fi
#echo "db type: $dbtype" >&2 # debug
Expand Down Expand Up @@ -1980,7 +1985,7 @@ fi

# Enable m2 volume support
# shellcheck disable=SC2010 # Don't warn about "Don't use ls | grep"
if ls /dev | grep -q "nv[em]"; then
if ls /dev | grep -q "nv[cm]"; then
if [[ $m2 != "no" ]]; then
if [[ $m2exists == "yes" ]]; then
# Check if m2 volume support is enabled
Expand Down

0 comments on commit 03bc2b4

Please sign in to comment.