Browse Source

Merge pull request #50 from 007revad/develop

Develop
pull/91/head v1.3.34
007revad 3 years ago
committed by GitHub
parent
commit
839929334b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      CHANGES.txt
  2. 53
      syno_hdd_db.sh

4
CHANGES.txt

@ -1,3 +1,7 @@
v1.3.34
- Now always shows your drive entries in the host db file if -s or --showedits used instead of only db file was edited during that run.
- Changed to show usage if invalid long option used instead of continuing.
v1.3.33 v1.3.33
- Fixed bug inserting firmware version for already existing model. - Fixed bug inserting firmware version for already existing model.

53
syno_hdd_db.sh

@ -24,11 +24,17 @@
# TODO # TODO
# Bypass M.2 volume lock for unsupported M.2 drives. # Bypass M.2 volume lock for unsupported M.2 drives.
# See https://github.com/007revad/Synology_enable_M2_volume
# #
# 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
# Now always shows your drive entries in the host db file if -s or --showedits used,
# instead of only db file was edited during that run.
#
# Changed to show usage if invalid long option used instead of continuing.
#
# Fixed bug inserting firmware version for already existing model. # Fixed bug inserting firmware version for already existing model.
# #
# Changed to add drives' firmware version to the db files (to support data deduplication). # Changed to add drives' firmware version to the db files (to support data deduplication).
@ -195,6 +201,9 @@ if options="$(getopt -o abcdefghijklmnopqrstuvwxyz0123456789 -a \
esac esac
shift shift
done done
else
echo
usage
fi fi
@ -963,27 +972,35 @@ fi
if [[ ${showedits,,} == "yes" ]]; then if [[ ${showedits,,} == "yes" ]]; then
getdbtype "$db1" getdbtype "$db1"
if [[ $dbtype -gt "6" ]];then if [[ $dbtype -gt "6" ]];then
# Show last 12 lines per drive + 4 # Show 11 lines after hdmodel line
#lines=$(((db1Edits *12) +4)) # without firmware version lines=11
lines=$(((db1Edits *21) +4)) # with firmware version
if [[ $db1Edits -gt "0" ]]; then
echo -e "\nChanges to ${Cyan}$(basename -- "$db1")${Off}"
jq . "$db1" | tail -n "$lines"
elif [[ $db2Edits -gt "0" ]]; then
echo -e "\nChanges to ${Cyan}$(basename -- "$db2")${Off}"
jq . "$db2" | tail -n "$lines"
fi
elif [[ $dbtype -eq "6" ]];then elif [[ $dbtype -eq "6" ]];then
# Show first 8 lines per drive + 2 # Show 2 lines after hdmodel line
lines=$(((db1Edits *8) +2)) lines=2
if [[ $db1Edits -gt "0" ]]; then fi
echo -e "\nChanges to ${Cyan}$(basename -- "$db1")${Off}"
jq . "$db1" | head -n "$lines" # HDDs/SSDs
elif [[ $db2Edits -gt "0" ]]; then if [[ ${#hdds[@]} -gt "0" ]]; then
echo -e "\nChanges to ${Cyan}$(basename -- "$db2")${Off}" num="0"
jq . "$db2" | head -n "$lines" while [[ $num -lt "${#hdds[@]}" ]]; do
hdmodel=$(printf "%s" "${hdds[$num]}" | cut -d"," -f 1)
echo
jq . "$db1" | grep -A "$lines" "$hdmodel"
num=$((num +1))
done
fi fi
# NVMe drives
if [[ ${#nvmes[@]} -gt "0" ]]; then
num="0"
while [[ $num -lt "${#nvmes[@]}" ]]; do
nvmemodel=$(printf "%s" "${nvmes[$num]}" | cut -d"," -f 1)
echo
jq . "$db1" | grep -A "$lines" "$nvmemodel"
num=$((num +1))
done
fi fi
fi fi

Loading…
Cancel
Save