From 6328fdf5c79e438c80b5815980847fbce7d5e728 Mon Sep 17 00:00:00 2001 From: The-going <48602507+The-going@users.noreply.github.com> Date: Thu, 19 Jan 2023 14:06:04 +0300 Subject: [PATCH] Fix: Uniquely determine the mount point in GetDevice --- packages/bsp/common/usr/bin/armbianmonitor | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/bsp/common/usr/bin/armbianmonitor b/packages/bsp/common/usr/bin/armbianmonitor index 0377707ea4..916b626c37 100755 --- a/packages/bsp/common/usr/bin/armbianmonitor +++ b/packages/bsp/common/usr/bin/armbianmonitor @@ -1039,13 +1039,10 @@ ShowDeviceWarning() { } # ShowDeviceWarning GetDevice() { - TestPath=$(findmnt --noheadings --output SOURCE,FSTYPE "$1" --uniq) - if [[ -z ${TestPath} ]]; then - [[ -n "${1%/*}" ]] \ - && GetDevice "${1%/*}" \ - || GetDevice "/" - else + if TestPath=$(findmnt --noheadings --output SOURCE,FSTYPE --target "$1" --uniq); then echo "${TestPath}" + else + echo "Bud Path: $1" >&2; exit 1 fi } # GetDevice