From 77e372287f6c2ec9edb126a96dffdcda9ee995f9 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Wed, 20 Dec 2023 21:36:47 +1100 Subject: [PATCH] Update syno_hdd_db.sh Bug fix for checking if script located on NVMe drive. --- syno_hdd_db.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index 5525201..6ba9913 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -295,8 +295,9 @@ echo "Running from: ${scriptpath}/$scriptfile" # Warn if script located on M.2 drive scriptvol=$(echo "$scriptpath" | cut -d"/" -f2) -result="$(lsblk | grep -B 4 /"$scriptvol" | grep nvme)" -if [[ -n $result ]]; then +vg=$(lvdisplay | grep /volume_"${volume#volume}" | cut -d"/" -f3) +md=$(pvdisplay | grep -B 1 "$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!" fi