Browse Source

Merge pull request #199 from 007revad/develop

Develop
pull/205/head
Dave Russell 2 years ago
committed by GitHub
parent
commit
25f74f5b23
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      CHANGES.txt
  2. 3
      README.md
  3. 25
      syno_hdd_db.sh

7
CHANGES.txt

@ -1,3 +1,10 @@
v3.3.75
- Include smart_test_ignore and smart_attr_ignore in db files.
- Now saves changes.txt as <script-filename>_changes.txt when updating the script.
- To not overwrite changes.txt if my other scripts are in the same folder.
- Bug fix for detecting if script is located on M.2 drive.
- Minor bug fix.
v3.3.73
- Bug fix for vendor id.

3
README.md

@ -126,7 +126,8 @@ ### vendor_ids.txt
| | | | |
|--------------------|--------------------|----------------------|----------------------|
| | Enric Escudé Santana | Yunhao Zhang | Matthias Gerhardt |
| | | Ez Hosting | Alec Wilhere |
| Reece Lyne | Enric Escudé Santana | Yunhao Zhang | Matthias Gerhardt |
| Darryl Harper | Mikescher | Matthias Pfaff | cpharada |
| Neil Tapp | zen1605 | Kleissner Investments | Angel Scandinavia |
| bcollins | Peter jackson | Mir Hekmat | Andrew Tapp |

25
syno_hdd_db.sh

@ -27,9 +27,10 @@
# Now warns if script is located on an M.2 volume.
scriptver="v3.3.73"
scriptver="v3.3.75"
script=Synology_HDD_db
repo="007revad/Synology_HDD_db"
scriptname=syno_hdd_db
# Check BASH variable is bash
if [ ! "$(basename "$BASH")" = bash ]; then
@ -296,9 +297,9 @@ echo "Running from: ${scriptpath}/$scriptfile"
# Warn if script located on M.2 drive
scriptvol=$(echo "$scriptpath" | cut -d"/" -f2)
vg=$(lvdisplay | grep /volume_"${scriptvol#volume}" | cut -d"/" -f3)
md=$(pvdisplay | grep -B 1 "$vg" | grep /dev/ | cut -d"/" -f3)
md=$(pvdisplay | grep -B 1 -E '[ ]'"$vg" | grep /dev/ | cut -d"/" -f3)
if cat /proc/mdstat | grep "$md" | grep nvme >/dev/null; then
echo "${Yellow}WARNING${Off} Don't store this script on an NVMe volume!"
echo -e "${Yellow}WARNING${Off} Don't store this script on an NVMe volume!"
fi
@ -381,7 +382,7 @@ if ! printf "%s\n%s\n" "$tag" "$scriptver" |
fi
# Copy new script sh file to script location
if ! cp -p "/tmp/$script-$shorttag/syno_hdd_db.sh" "${scriptpath}/${scriptfile}";
if ! cp -p "/tmp/$script-$shorttag/${scriptname}.sh" "${scriptpath}/${scriptfile}";
then
copyerr=1
echo -e "${Error}ERROR${Off} Failed to copy"\
@ -410,10 +411,12 @@ if ! printf "%s\n%s\n" "$tag" "$scriptver" |
fi
fi
# Copy new CHANGES.txt file
# Copy new CHANGES.txt file to script location (if script on a volume)
if [[ $scriptpath =~ /volume* ]]; then
# Copy new CHANGES.txt file to script location
if ! cp -p "/tmp/$script-$shorttag/CHANGES.txt" "$scriptpath"; then
if ! cp -p "/tmp/$script-$shorttag/CHANGES.txt"\
"${scriptpath}/${scriptname}_CHANGES.txt";
then
if [[ $autoupdate != "yes" ]]; then copyerr=1; fi
echo -e "${Error}ERROR${Off} Failed to copy"\
"$script-$shorttag/CHANGES.txt to:\n $scriptpath"
@ -424,7 +427,7 @@ if ! printf "%s\n%s\n" "$tag" "$scriptver" |
echo -e "${Error}ERROR${Off} Failed to set permissions on:"
echo "$scriptpath/CHANGES.txt"
fi
changestxt=", changes.txt"
changestxt=" and changes.txt"
fi
fi
@ -433,7 +436,7 @@ if ! printf "%s\n%s\n" "$tag" "$scriptver" |
# Notify of success (if there were no errors)
if [[ $copyerr != 1 ]] && [[ $permerr != 1 ]]; then
echo -e "\n$tag$changestxt$vids_txt downloaded to: ${scriptpath}\n"
echo -e "\n$tag ${scriptfile}$vids_txt$changestxt downloaded to: ${scriptpath}\n"
syslog_set info "$script successfully updated to $tag"
# Reload script
@ -1121,11 +1124,13 @@ updatedb(){
else
fwstrng=\"$fwrev\"
fwstrng="$fwstrng":{\"compatibility_interval\":[{\"compatibility\":\"support\",\"not_yet_rolling_status\"
fwstrng="$fwstrng":\"support\",\"fw_dsm_update_status_notify\":false,\"barebone_installable\":true}]},
fwstrng="$fwstrng":\"support\",\"fw_dsm_update_status_notify\":false,\"barebone_installable\":true,
fwstrng="$fwstrng"\"smart_test_ignore\":false,\"smart_attr_ignore\":false}]},
default=\"default\"
default="$default":{\"compatibility_interval\":[{\"compatibility\":\"support\",\"not_yet_rolling_status\"
default="$default":\"support\",\"fw_dsm_update_status_notify\":false,\"barebone_installable\":true}]}}}
default="$default":\"support\",\"fw_dsm_update_status_notify\":false,\"barebone_installable\":true,
default="$default"\"smart_test_ignore\":false,\"smart_attr_ignore\":false}]}}},
if grep '"disk_compatbility_info":{}' "$2" >/dev/null; then
# Replace "disk_compatbility_info":{} with

Loading…
Cancel
Save