From 7a0f5b688792bdc1fd6f664b034573b2a8c4be19 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:47:36 +1100 Subject: [PATCH] Update syno_hdd_db.sh --- syno_hdd_db.sh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index c3b581e..e2b8314 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -239,11 +239,11 @@ fi #echo -e "bash version: $(bash --version | head -1 | cut -d' ' -f4)\n" # debug -ding(){ +ding(){ printf \\a } -usage(){ +usage(){ cat < /run/synostorage/disks/"$(basename -- "$1")"/m2_pool_support @@ -1013,7 +1013,7 @@ fi # Don't check .db.new as new installs don't have a .db.new file -getdbtype(){ +getdbtype(){ # Detect drive db type if grep -F '{"disk_compatbility_info":' "$1" >/dev/null; then # DSM 7 drive db files start with {"disk_compatbility_info": @@ -1029,7 +1029,7 @@ getdbtype(){ } -backupdb(){ +backupdb(){ # Backup database file if needed if [[ ! -f "$1.bak" ]]; then if [[ $(basename "$1") == "synoinfo.conf" ]]; then @@ -1069,7 +1069,7 @@ done #------------------------------------------------------------------------------ # Edit db files -editcount(){ +editcount(){ # Count drives added to host db files if [[ $1 =~ .*\.db$ ]]; then db1Edits=$((db1Edits +1)) @@ -1079,7 +1079,7 @@ editcount(){ } -editdb7(){ +editdb7(){ if [[ $1 == "append" ]]; then # model not in db file #if sed -i "s/}}}/}},\"$hdmodel\":{$fwstrng$default/" "$2"; then # append if sed -i "s/}}}/}},\"${hdmodel//\//\\/}\":{$fwstrng$default/" "$2"; then # append @@ -1114,7 +1114,7 @@ editdb7(){ } -updatedb(){ +updatedb(){ hdmodel=$(printf "%s" "$1" | cut -d"," -f 1) fwrev=$(printf "%s" "$1" | cut -d"," -f 2) @@ -1239,7 +1239,7 @@ done # RS822RP+, RS822+, RS1221RP+ and RS1221+ with DSM older than 7.2 need # device tree blob file from DSM 7.2 to support M2D18 -enable_card(){ +enable_card(){ # $1 is the file # $2 is the section # $3 is the card model and mode @@ -1264,7 +1264,7 @@ enable_card(){ } -dts_m2_card(){ +dts_m2_card(){ # $1 is the card model # $2 is the dts file @@ -1338,7 +1338,7 @@ fi } -download_dtc(){ +download_dtc(){ # Download dtc from github echo "Downloading dtc" >&2 if cd /var/services/tmp; then @@ -1354,7 +1354,7 @@ download_dtc(){ } -edit_dts(){ +edit_dts(){ #set -x # debug @@ -1374,7 +1374,7 @@ edit_dts(){ } -set_pwr_limit(){ +set_pwr_limit(){ if ! grep "$pwr_limit" "$dts_file" >/dev/null; then # Save current power_limit pwr_lmt_old=$(grep power_limit "$dts_file" | cut -d\" -f2) @@ -1407,7 +1407,7 @@ set_pwr_limit(){ } -check_modeldtb(){ +check_modeldtb(){ # $1 is E10M20-T1 or M2D20 or M2D18 or M2D17 if [[ -f /etc.defaults/model.dtb ]]; then # Is device tree model # Get syn_hw_revision, r1 or r2 etc (or just a linefeed if not a revision)