@ -3,7 +3,7 @@
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
# Github: https://github.com/007revad/Synology_HDD_db
# Github: https://github.com/007revad/Synology_HDD_db
# Script verified at https://www.shellcheck.net/
# Script verified at https://www.shellcheck.net/
# Tested on DSM 7.1.1 and DSM 6.2.4
# Tested on DSM 7.2 beta, 7. 1.1 and DSM 6.2.4
#
#
# Easiest solution:
# Easiest solution:
# Edit /etc.defaults/synoinfo.conf and change support_disk_compatibility="yes" to "no" and reboot.
# Edit /etc.defaults/synoinfo.conf and change support_disk_compatibility="yes" to "no" and reboot.
@ -25,15 +25,15 @@
# TODO
# TODO
# Bypass M.2 volume lock for unsupported M.2 drives.
# Bypass M.2 volume lock for unsupported M.2 drives.
#
#
# Detect if expansion unit(s) connected and get model(s) and edit expansion unit db files.
# Or add support for specifying user's expansion unit model(s) as arguments.
# Or maybe use the shotgun approach and update all expansion unit db files.
#
# Maybe also edit the other disk compatibility db in synoboot, used during boot time.
# Maybe also edit the other disk compatibility db in synoboot, used during boot time.
# It's also parsed and checked and probably in some cases it could be more critical to patch that one instead.
# It's also parsed and checked and probably in some cases it could be more critical to patch that one instead.
# DONE
# DONE
# Added support for M.2 drives on a PCI card (M2Dxx and E10G18-T1 and future models).
# Added option to disable incompatible memory notifications.
#
# Now finds your expansion units' model numbers and adds your drives to their db files.
#
# Now adds your M.2 drives to your M.2 PCI cards db files (M2Dxx and E10M20-T1 and future models).
#
#
# Improved flags/options checking and added usage help.
# Improved flags/options checking and added usage help.
#
#
@ -47,6 +47,12 @@
#
#
# Changed checking drive_db_test_url setting to be more durable.
# Changed checking drive_db_test_url setting to be more durable.
#
#
# Added removal of " 00Y" from end of Samsung/Lenovo SSDs to fix issue #13.
#
# Fixed bug where removable drives were being detected and added to drive database.
#
# Fixed bug where "M.2 volume support already enabled" message appeared when NAS had no M.2 drives.
#
#
#
# Added check that M.2 volume support is enabled (on supported models).
# Added check that M.2 volume support is enabled (on supported models).
#
#
@ -78,10 +84,11 @@
# Optionally disable "support_disk_compatibility".
# Optionally disable "support_disk_compatibility".
scriptver = "v1.1.15 "
scriptver = "v1.2.18 "
script = Synology_HDD_db
script = Synology_HDD_db
repo = "007revad/Synology_HDD_db"
repo = "007revad/Synology_HDD_db"
#echo -e "bash version: $(bash --version | head -1 | cut -d' ' -f4)\n" # debug
# Shell Colors
# Shell Colors
#Black='\e[0;30m'
#Black='\e[0;30m'
@ -118,18 +125,17 @@ exit 0
scriptversion( ) {
scriptversion( ) {
cat <<EOF
cat <<EOF
$script $scriptver
$script $scriptver - by 007revad
by 007revad
https://github.com/$repo
See https://github.com/$repo
EOF
EOF
exit 0
exit 0
}
}
# Check for flags with getopt
# Check for flags with getopt
options = " $( getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \
if options = " $( getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \
-l showedits,noupdate,m2,force,ram,help,version -- " $@ " ) "
-l showedits,noupdate,m2,force,ram,help,version -- " $@ " ) " ; then
if [ [ $? -eq "0" ] ] ; then
eval set -- " $options "
eval set -- " $options "
while true; do
while true; do
case " ${ 1 ,, } " in
case " ${ 1 ,, } " in
@ -145,8 +151,8 @@ if [[ $? -eq "0" ]]; then
-f| --force) # Disable "support_disk_compatibility"
-f| --force) # Disable "support_disk_compatibility"
force = yes
force = yes
; ;
; ;
-r| --ram) # Include memory compatibility
-r| --ram) # Disable "support_memory_compatibility"
ram = yes # for future use
ram = yes
; ;
; ;
-h| --help) # Show usage options
-h| --help) # Show usage options
usage
usage
@ -181,22 +187,35 @@ if [[ $dsm -gt "6" ]]; then
fi
fi
# Get Synology model
# Get Synology model
model = $( cat /proc/sys/kernel/syno_hw_version) # not always the actual model number
modeltype = $( printf "%s" " $model " | sed 's/[0-9].*//' ) # DS, RS etc
# This doesn't work for drives migrated from different model
#model=$(find /var/lib/disk-compatibility -regextype egrep -regex ".*host(_v7)?\.db$" |\
# cut -d"/" -f5 | cut -d"_" -f1 | uniq)
unique = $( get_key_value /etc/synoinfo.conf unique | cut -d'_' -f3) # 920+ etc
model = $( cat /proc/sys/kernel/syno_hw_version)
# Remove extra text from end, like DS213pv10-j and DS1817+-j
#[[ $model =~ ([0-9]{3,}) ]] && modelnum=${BASH_REMATCH[1]}
[ [ $model = ~ ( [ 0-9] { 3,} ( RP\+ | RPxs| RP| \+ II| xsII| xs\+ | xs| \+ | j| slim| play| se| air| D) ?) ] ] && \
modelnum = ${ BASH_REMATCH [1] }
if [ [ $modelnum != " $unique " ] ] ; the n
# Show script version
model = " $modeltype $unique "
echo " $script $scriptver "
fi
#echo "github.com/$repo"
model = ${ model ,, } # convert to lower case
# Show NAS info
productversion = $( get_key_value /etc.defaults/VERSION productversion)
buildphase = $( get_key_value /etc.defaults/VERSION buildphase)
if [ [ $buildphase = = GM ] ] ; then buildphase = "" ; fi
echo " $model DSM $productversion $buildphase "
echo ""
# Convert model to lower case
model = ${ model ,, }
# Check for dodgy characters after model number
if [ [ $model = ~ 'pv10-j' $ ] ] ; then # GitHub issue #10
model = ${ model %?????? } + # replace last 6 chars with +
elif [ [ $model = ~ '-j' $ ] ] ; then # GitHub issue #2
model = ${ model %?? } # remove last 2 chars
fi
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
@ -260,19 +279,35 @@ fi
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Get list of installed SATA, SAS and M.2 NVMe/SATA drives
# Get list of installed SATA, SAS and M.2 NVMe/SATA drives,
# PCIe M.2 cards and connected Expansion Units.
fixdrivemodel( ) {
# Remove " 00Y" from end of Samsung/Lenovo SSDs
# To fix issue #13
if [ [ $1 = ~ MZ.*" 00Y" ] ] ; then
hdmodel = $( printf "%s" " $1 " | sed 's/ 00Y.*//' )
fi
}
getdriveinfo( ) {
getdriveinfo( ) {
# Skip removable drives (USB drives)
removable = $( cat " $1 /removable " )
if [ [ $removable = = "0" ] ] ; then
# Get drive model and firmware version
# Get drive model and firmware version
hdmodel = $( cat " $1 /device/model " )
hdmodel = $( cat " $1 /device/model " )
hdmodel = $( printf "%s" " $hdmodel " | xargs) # trim leading and trailing white space
hdmodel = $( printf "%s" " $hdmodel " | xargs) # trim leading and trailing white space
# Fix dodgy model numbers
fixdrivemodel " $hdmodel "
fwrev = $( cat " $1 /device/rev " )
fwrev = $( cat " $1 /device/rev " )
fwrev = $( printf "%s" " $fwrev " | xargs) # trim leading and trailing white space
fwrev = $( printf "%s" " $fwrev " | xargs) # trim leading and trailing white space
if [ [ $hdmodel ] ] && [ [ $fwrev ] ] ; then
if [ [ $hdmodel ] ] && [ [ $fwrev ] ] ; then
hdlist += ( " ${ hdmodel } , ${ fwrev } " )
hdlist += ( " ${ hdmodel } , ${ fwrev } " )
fi
fi
fi
}
}
getm2info( ) {
getm2info( ) {
@ -291,7 +326,8 @@ getm2info() {
}
}
getcardmodel( ) {
getcardmodel( ) {
# Get M.2 card model
# Get M.2 card model (if M.2 drives found)
if [ [ ${# nvmelist [@] } -gt "0" ] ] ; then
cardmodel = $( synodisk --m2-card-model-get " $1 " )
cardmodel = $( synodisk --m2-card-model-get " $1 " )
if [ [ $cardmodel = ~ M2D[ 0-9] [ 0-9] ] ] ; then
if [ [ $cardmodel = ~ M2D[ 0-9] [ 0-9] ] ] ; then
# M2 adaptor card
# M2 adaptor card
@ -302,6 +338,7 @@ getcardmodel() {
m2carddblist += ( " ${ model } _ ${ cardmodel ,, } ${ version } .db " ) # M.2 card's db file
m2carddblist += ( " ${ model } _ ${ cardmodel ,, } ${ version } .db " ) # M.2 card's db file
m2cardlist += ( " $cardmodel " ) # M.2 card
m2cardlist += ( " $cardmodel " ) # M.2 card
fi
fi
fi
}
}
@ -342,21 +379,12 @@ for d in /sys/block/*; do
done
done
sortarray( ) {
# Sort $1 array into new $2 array to remove duplicates
local -n inarray = $1
outarray = ( )
if [ [ ${# inarray [@] } -gt "0" ] ] ; then
while IFS = read -r -d '' x; do
outarray += ( " $x " )
done < <( printf "%s\0" " ${ inarray [@] } " | sort -uz)
fi
}
# Sort hdlist array into new hdds array to remove duplicates
# Sort hdlist array into new hdds array to remove duplicates
sortarray "hdlist"
if [ [ ${# hdlist [@] } -gt "0" ] ] ; then
hdds = ${ outarray [*] }
while IFS = read -r -d '' x; do
hdds += ( " $x " )
done < <( printf "%s\0" " ${ hdlist [@] } " | sort -uz)
fi
# Check hdds array isn't empty
# Check hdds array isn't empty
if [ [ ${# hdds [@] } -eq "0" ] ] ; then
if [ [ ${# hdds [@] } -eq "0" ] ] ; then
@ -373,15 +401,18 @@ fi
# Sort nvmelist array into new nvmes array to remove duplicates
# Sort nvmelist array into new nvmes array to remove duplicates
sortarray "nvmelist"
if [ [ ${# nvmelist [@] } -gt "0" ] ] ; then
nvmes = ${ outarray [*] }
while IFS = read -r -d '' x; do
nvmes += ( " $x " )
done < <( printf "%s\0" " ${ nvmelist [@] } " | sort -uz)
fi
# Check nvmes array isn't empty
# Check nvmes array isn't empty
if [ [ ${# nvmes [@] } -eq "0" ] ] ; then
if [ [ $m2 != "no " ] ] ; then
if [ [ $m2 != "no " ] ] ; then
if [ [ ${# nvmes [@] } -eq "0 " ] ] ; then
echo -e "No M.2 drives found\n"
echo -e "No M.2 drives found\n"
fi
else
else
m2exists = "yes"
echo " M.2 drive models found: ${# nvmes [@] } "
echo " M.2 drive models found: ${# nvmes [@] } "
num = "0"
num = "0"
while [ [ $num -lt " ${# nvmes [@] } " ] ] ; do
while [ [ $num -lt " ${# nvmes [@] } " ] ] ; do
@ -389,18 +420,25 @@ else
num = $(( num + 1 ))
num = $(( num + 1 ))
done
done
echo
echo
fi
fi
fi
# M.2 card db files
# M.2 card db files
# Sort m2carddblist array into new m2carddbs array to remove duplicates
# Sort m2carddblist array into new m2carddbs array to remove duplicates
sortarray "m2carddblist"
if [ [ ${# m2carddblist [@] } -gt "0" ] ] ; then
m2carddbs = ${ outarray [*] }
while IFS = read -r -d '' x; do
m2carddbs += ( " $x " )
done < <( printf "%s\0" " ${ m2carddblist [@] } " | sort -uz)
fi
# M.2 cards
# M.2 cards
# Sort m2cardlist array into new m2cards array to remove duplicates
# Sort m2cardlist array into new m2cards array to remove duplicates
sortarray "m2cardlist"
if [ [ ${# m2cardlist [@] } -gt "0" ] ] ; then
m2cards = ${ outarray [*] }
while IFS = read -r -d '' x; do
m2cards += ( " $x " )
done < <( printf "%s\0" " ${ m2cardlist [@] } " | sort -uz)
fi
# Check m2cards array isn't empty
# Check m2cards array isn't empty
if [ [ ${# m2cards [@] } -gt "0" ] ] ; then
if [ [ ${# m2cards [@] } -gt "0" ] ] ; then
@ -414,6 +452,36 @@ if [[ ${#m2cards[@]} -gt "0" ]]; then
fi
fi
# Expansion units
# Get list of connected expansion units (aka eunit/ebox)
path = "/var/log/diskprediction"
# shellcheck disable=SC2012
file = $( ls $path | tail -n1)
# shellcheck disable=SC2207
eunitlist = ( $( grep -Eow "([FRD]XD?[0-9]{3,4})(RP|II|sas){0,2}" " $path / $file " | uniq) )
# Sort eunitlist array into new eunits array to remove duplicates
if [ [ ${# eunitlist [@] } -gt "0" ] ] ; then
while IFS = read -r -d '' x; do
eunits += ( " $x " )
done < <( printf "%s\0" " ${ eunitlist [@] } " | sort -uz)
fi
# Check eunits array isn't empty
if [ [ ${# eunits [@] } -eq "0" ] ] ; then
echo -e "No Expansion Units found\n"
else
#eunitexists="yes"
echo " Expansion Unit models found: ${# eunits [@] } "
num = "0"
while [ [ $num -lt " ${# eunits [@] } " ] ] ; do
echo " ${ eunits [num] } "
num = $(( num + 1 ))
done
echo
fi
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Check databases and add our drives if needed
# Check databases and add our drives if needed
@ -429,27 +497,32 @@ if [[ ! -f "$db1" ]]; then echo -e "${Error}ERROR 3${Off} $db1 not found!" && ex
# new installs don't have a .db.new file
# new installs don't have a .db.new file
# Detect drive db type
getdbtype( ) {
if grep -F '{"disk_compatbility_info":' " $db1 " >/dev/null; then
# Detect drive db type
if grep -F '{"disk_compatbility_info":' " $1 " >/dev/null; then
# DSM 7 drive db files start with {"disk_compatbility_info":
# DSM 7 drive db files start with {"disk_compatbility_info":
dbtype = 7
dbtype = 7
elif grep -F '{"success":1,"list":[' " $db 1 " >/dev/null; then
elif grep -F '{"success":1,"list":[' " $1 " >/dev/null; then
# DSM 6 drive db files start with {"success":1,"list":[
# DSM 6 drive db files start with {"success":1,"list":[
dbtype = 6
dbtype = 6
else
else
echo -e " ${ Error } ERROR ${ Off } Unknown database type $( basename -- " ${ db1 } " ) ! "
echo -e " ${ Error } ERROR ${ Off } Unknown database type $( basename -- " ${ 1 } " ) ! " >& 2
exit 7
dbtype = 1
fi
fi
#echo "dbtype: $dbtype" # debug
#echo "db type: $dbtype" >&2 # debug
}
backupdb( ) {
backupdb( ) {
# Backup database file if needed
# Backup database file if needed
if [ [ ! -f " $1 .bak " ] ] ; then
if [ [ ! -f " $1 .bak " ] ] ; then
if [ [ $( basename " $1 " ) = = "synoinfo.conf" ] ] ; then
echo "" >& 2
fi
if cp " $1 " " $1 .bak " ; then
if cp " $1 " " $1 .bak " ; then
echo -e " \nBacked up $( basename -- " ${ 1 } " ) database.\n "
echo -e " Backed up $( basename -- " ${ 1 } " ) " >& 2
else
else
echo -e " ${ Error } ERROR 5 ${ Off } Failed to backup $( basename -- " ${ 1 } " ) ! "
echo -e " ${ Error } ERROR 5 ${ Off } Failed to backup $( basename -- " ${ 1 } " ) ! " >& 2
return 1
return 1
fi
fi
fi
fi
@ -459,9 +532,6 @@ backupdb() {
# Backup host database file if needed
# Backup host database file if needed
backupdb " $db1 " || exit 5
backupdb " $db1 " || exit 5
# Backup synoinfo.conf if needed
backupdb " $synoinfo " || exit 9
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Edit db files
# Edit db files
@ -470,14 +540,17 @@ updatedb() {
hdmodel = $( printf "%s" " $1 " | cut -d"," -f 1)
hdmodel = $( printf "%s" " $1 " | cut -d"," -f 1)
fwrev = $( printf "%s" " $1 " | cut -d"," -f 2)
fwrev = $( printf "%s" " $1 " | cut -d"," -f 2)
#echo arg1 "$1" # debug
#echo arg1 "$1" >&2 # debug
#echo arg2 "$2" # debug
#echo arg2 "$2" >&2 # debug
#echo hdmodel "$hdmodel" # debug
#echo hdmodel "$hdmodel" >&2 # debug
#echo fwrev "$fwrev" # debug
#echo fwrev "$fwrev" >&2 # debug
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 } "
echo -e " ${ Yellow } $hdmodel ${ Off } already exists in ${ Cyan } $( basename -- " $2 " ) ${ Off } " >& 2
else
else
# Check if db file is new or old style
getdbtype " $2 "
if [ [ $dbtype -gt "6" ] ] ; then
if [ [ $dbtype -gt "6" ] ] ; then
# Don't need to add firmware version?
# Don't need to add firmware version?
fwstrng = \" $fwrev \"
fwstrng = \" $fwrev \"
@ -503,7 +576,7 @@ updatedb() {
echo -e " \n ${ Error } ERROR 6 ${ Off } Failed to update v7 $( basename -- " $2 " ) ${ Off } "
echo -e " \n ${ Error } ERROR 6 ${ Off } Failed to update v7 $( basename -- " $2 " ) ${ Off } "
exit 6
exit 6
fi
fi
els e
elif [ [ $dbtyp e -eq "6" ] ] ; then
# example:
# example:
# {"model":"WD60EFRX-68MYMN1","firmware":"82.00A82","rec_intvl":[1]},
# {"model":"WD60EFRX-68MYMN1","firmware":"82.00A82","rec_intvl":[1]},
# Don't need to add firmware version?
# Don't need to add firmware version?
@ -512,9 +585,9 @@ updatedb() {
# {"success":1,"list":[
# {"success":1,"list":[
startstring = "{\"success\":1,\"list\":\["
startstring = "{\"success\":1,\"list\":\["
#echo "$startstring" # debug
#echo "$startstring" >&2 # debug
#echo "$string" # debug
#echo "$string" >&2 # debug
#echo # debug
#echo >&2 # debug
# example:
# example:
# {"success":1,"list":[{"model":"WD60EFRX-68MYMN1","firmware":"82.00A82","rec_intvl":[1]},
# {"success":1,"list":[{"model":"WD60EFRX-68MYMN1","firmware":"82.00A82","rec_intvl":[1]},
@ -529,7 +602,7 @@ updatedb() {
fi
fi
else
else
echo -e " \n ${ Error } ERROR 8 ${ Off } Failed to update $( basename -- " $2 " ) ${ Off } "
echo -e " \n ${ Error } ERROR 8 ${ Off } Failed to update $( basename -- " $2 " ) ${ Off } " >& 2
exit 8
exit 8
fi
fi
fi
fi
@ -543,6 +616,22 @@ while [[ $num -lt "${#hdds[@]}" ]]; do
if [ [ -f " $db2 " ] ] ; then
if [ [ -f " $db2 " ] ] ; then
updatedb " ${ hdds [ $num ] } " " $db2 "
updatedb " ${ hdds [ $num ] } " " $db2 "
fi
fi
#------------------------------------------------
# Expansion Units
num2 = "0"
while [ [ $num2 -lt " ${# eunits [@] } " ] ] ; do
eudb = " ${ dbpath } ${ eunits [ $num2 ],, } ${ version } .db "
if [ [ -f " $eudb " ] ] ; then
backupdb " $eudb " && \
updatedb " ${ hdds [ $num ] } " " $eudb "
else
echo -e " ${ Error } ERROR 11 ${ Off } $eudb not found! "
fi
num2 = $(( num2 + 1 ))
done
#------------------------------------------------
num = $(( num + 1 ))
num = $(( num + 1 ))
done
done
@ -575,6 +664,9 @@ done
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Edit /etc.defaults/synoinfo.conf
# Edit /etc.defaults/synoinfo.conf
# Backup synoinfo.conf if needed
backupdb " $synoinfo " || exit 9
# Optionally disable "support_disk_compatibility"
# Optionally disable "support_disk_compatibility"
sdc = support_disk_compatibility
sdc = support_disk_compatibility
setting = " $( get_key_value $synoinfo $sdc ) "
setting = " $( get_key_value $synoinfo $sdc ) "
@ -599,29 +691,58 @@ else
fi
fi
# Check m2 volume support enabled
# Optionally disable "support_memory_compatibility"
smp = support_m2_pool
smc = support_memory_compatibility
setting = " $( get_key_value $synoinfo ${ smp } ) "
setting = " $( get_key_value $synoinfo $smc ) "
enabled = ""
if [ [ $ram = = "yes" ] ] ; then
if [ [ ! $setting ] ] ; 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
# Check if m2 volume support is enabled
smp = support_m2_pool
setting = " $( get_key_value $synoinfo ${ smp } ) "
enabled = ""
if [ [ ! $setting ] ] ; then
# Add support_m2_pool"yes"
# Add support_m2_pool"yes"
echo 'support_m2_pool="yes"' >> " $synoinfo "
echo 'support_m2_pool="yes"' >> " $synoinfo "
enabled = "yes"
enabled = "yes"
elif [ [ $setting = = "no" ] ] ; then
elif [ [ $setting = = "no" ] ] ; then
# Change support_m2_pool"no" to "yes"
# Change support_m2_pool"no" to "yes"
sed -i " s/ ${ smp } =\"no\"/ ${ smp } =\"yes\"/ " " $synoinfo "
sed -i " s/ ${ smp } =\"no\"/ ${ smp } =\"yes\"/ " " $synoinfo "
enabled = "yes"
enabled = "yes"
elif [ [ $setting = = "yes" ] ] ; then
elif [ [ $setting = = "yes" ] ] ; then
echo -e "\nM.2 volume support already enabled."
echo -e "\nM.2 volume support already enabled."
fi
fi
# Check if we enabled m2 volume support
# Check if we enabled m2 volume support
setting = " $( get_key_value $synoinfo ${ smp } ) "
setting = " $( get_key_value $synoinfo ${ smp } ) "
if [ [ $enabled = = "yes" ] ] ; then
if [ [ $enabled = = "yes" ] ] ; then
if [ [ $setting = = "yes" ] ] ; then
if [ [ $setting = = "yes" ] ] ; then
echo -e "\nEnabled M.2 volume support."
echo -e "\nEnabled M.2 volume support."
else
else
echo -e " ${ Error } ERROR ${ Off } Failed to enable m2 volume support! "
echo -e " \n ${ Error } ERROR ${ Off } Failed to enable m2 volume support! "
fi
fi
fi
fi
fi
fi
@ -647,7 +768,7 @@ if [[ $nodbupdate == "yes" ]]; then
if [ [ $url = = "127.0.0.1" ] ] ; then
if [ [ $url = = "127.0.0.1" ] ] ; then
echo -e "\nDisabled drive db auto updates."
echo -e "\nDisabled drive db auto updates."
else
else
echo -e " ${ Error } ERROR ${ Off } Failed to disable drive db auto updates! "
echo -e " \n ${ Error } ERROR ${ Off } Failed to disable drive db auto updates! "
fi
fi
fi
fi
else
else
@ -673,6 +794,7 @@ fi
# Show the changes
# Show the changes
if [ [ ${ showedits ,, } = = "yes" ] ] ; then
if [ [ ${ showedits ,, } = = "yes" ] ] ; then
getdbtype " $db1 "
if [ [ $dbtype -gt "6" ] ] ; then
if [ [ $dbtype -gt "6" ] ] ; then
# Show last 12 lines per drive + 4
# Show last 12 lines per drive + 4
lines = $(( ( db1Edits * 12 ) + 4 ))
lines = $(( ( db1Edits * 12 ) + 4 ))
@ -683,7 +805,7 @@ if [[ ${showedits,,} == "yes" ]]; then
echo -e " \nChanges to ${ Cyan } $( basename -- " $db2 " ) ${ Off } "
echo -e " \nChanges to ${ Cyan } $( basename -- " $db2 " ) ${ Off } "
jq . " $db2 " | tail -n " $lines "
jq . " $db2 " | tail -n " $lines "
fi
fi
els e
elif [ [ $dbtyp e -eq "6" ] ] ; then
# Show first 8 lines per drive + 2
# Show first 8 lines per drive + 2
lines = $(( ( db1Edits * 8 ) + 2 ))
lines = $(( ( db1Edits * 8 ) + 2 ))
if [ [ $db1Edits -gt "0" ] ] ; then
if [ [ $db1Edits -gt "0" ] ] ; then