Browse Source

Merge pull request #277 from 007revad/develop

Develop
pull/283/head v3.5.89
Dave Russell 2 years ago
committed by GitHub
parent
commit
590f3e1d98
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      CHANGES.txt
  2. 49
      syno_hdd_db.sh

3
CHANGES.txt

@ -1,3 +1,6 @@
v3.5.89
- Bug fix for -s, --showedits option with multiple of the same drive model but with different firmware versions. Issue #276
v3.5.88 v3.5.88
- Changed how memory compatibility is disabled for older models. Issue #272 - Changed how memory compatibility is disabled for older models. Issue #272

49
syno_hdd_db.sh

@ -16,6 +16,9 @@
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------
# CHANGES # CHANGES
# Bug fix for -s, --showedits option for multiple of the same drive model
# but with different firmware versions. Issue #276
#
# Changed disabling memory compatibility for older models. Issue #272 # Changed disabling memory compatibility for older models. Issue #272
# #
# Hard coded /usr/syno/bin/<command> for Synology commands (to prevent $PATH issues). # Hard coded /usr/syno/bin/<command> for Synology commands (to prevent $PATH issues).
@ -37,7 +40,7 @@
# /var/packages/StorageManager/target/ui/storage_panel.js # /var/packages/StorageManager/target/ui/storage_panel.js
scriptver="v3.5.88" scriptver="v3.5.89"
script=Synology_HDD_db script=Synology_HDD_db
repo="007revad/Synology_HDD_db" repo="007revad/Synology_HDD_db"
scriptname=syno_hdd_db scriptname=syno_hdd_db
@ -1920,32 +1923,30 @@ fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Finished # Finished
show_changes(){
# Assign passed drive models array to my_array
local my_array=("$@")
local drive_models=()
for i in "${!my_array[@]}"; do
drive_models+=$(printf "%s" "${my_array[i]}" | cut -d"," -f 1)
done
# Sort array to remove duplicates
IFS=$'\n'
drives_sorted=($(sort -u <<<"${drive_models[*]}"))
unset IFS
for drive_model in "${drives_sorted[@]}"; do
echo -e "\n$drive_model:"
jq -r --arg drive_model "$drive_model" '.disk_compatbility_info[$drive_model]' "${db1list[0]}"
done
}
# Show the changes # Show the changes
if [[ ${showedits,,} == "yes" ]]; then if [[ ${showedits,,} == "yes" ]]; then
if [[ ${#db1list[@]} -gt "0" ]]; then # HDDs/SSDs
getdbtype "${db1list[0]}" show_changes "${hdds[@]}"
if [[ $dbtype -gt "6" ]]; then
# Show 11 lines after hdmodel line
lines=11
elif [[ $dbtype -eq "6" ]]; then
# Show 2 lines after hdmodel line
lines=2
fi
# HDDs/SSDs
for i in "${!hdds[@]}"; do
hdmodel=$(printf "%s" "${hdds[i]}" | cut -d"," -f 1)
echo
jq . "${db1list[0]}" | grep -A "$lines" "$hdmodel"
done
# NVMe drives # NVMe drives
for i in "${!nvmes[@]}"; do show_changes "${nvmes[@]}"
hdmodel=$(printf "%s" "${nvmes[i]}" | cut -d"," -f 1)
echo
jq . "${db1list[0]}" | grep -A "$lines" "$hdmodel"
done
fi
fi fi

Loading…
Cancel
Save