From f8445488794ef0ba7084486bfa9267be2648f160 Mon Sep 17 00:00:00 2001 From: 007revad <39733752+007revad@users.noreply.github.com> Date: Mon, 27 Feb 2023 21:35:07 +1100 Subject: [PATCH] Update syno_hdd_db.sh Changed to avoid issue #2 --- syno_hdd_db.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index f374ae1..b1bb53d 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -71,7 +71,7 @@ done # SATA drives sda, sdb etc for drive in /dev/sd*; do - if [[ $drive =~ /dev/sd[a-z]{1,3}$ ]]; then + if [[ $drive =~ /dev/sd[a-z]{1,2}$ ]]; then tmp=$(hdparm -i "$drive" | grep Model) hdmodel=$(printf %s "$tmp" | cut -d"," -f 1 | cut -d"=" -f 2) fwrev=$(printf %s "$tmp" | cut -d"," -f 2 | cut -d"=" -f 2) @@ -227,15 +227,11 @@ done if [[ ${showedits,,} == "yes" ]]; then lines=$(((db2Edits *12) +4)) if [[ $db1Edits -gt "0" ]]; then - #echo -e "\nChanges to $(basename -- "$db1")" echo -e "\nChanges to ${Cyan}$(basename -- "$db1")${Off}" - #jq . "$db1" # nice colorized json format but displays whole file jq . "$db1" | tail -n "$lines" # show last 20 lines per edit fi if [[ $db2Edits -gt "0" ]]; then - #echo -e "\nChanges to $(basename -- "$db2")" echo -e "\nChanges to ${Cyan}$(basename -- "$db2")${Off}" - #jq . "$db2" | tail -n $((db2Edits *16)) # show last 20 lines per edit jq . "$db2" | tail -n "$lines" # show last 20 lines per edit fi fi