From 586533c95b1996249131f356a2d46942043f14c0 Mon Sep 17 00:00:00 2001 From: "Rob Pearce (mimic)" Date: Fri, 10 Dec 2021 10:16:30 +1100 Subject: [PATCH] Fix unmounting on linux systems --- bare.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bare.sh b/bare.sh index 847d592..ac36e6f 100755 --- a/bare.sh +++ b/bare.sh @@ -465,10 +465,17 @@ function restorecmd_help() { } function is_mounted() { - local dir dev1 dev2 rv + local dir dev1 dev2 rv formatarg dir="$1" - dev1=$(stat -f %d $dir 2>/dev/null) - dev2=$(stat -f %d $dir/.. 2>/dev/null) + + if [[ $(uname -s) == "Linux" ]]; then + formatarg="-c" + else + formatarg="-f" + fi + + dev1=$(stat $formatarg %d $dir 2>/dev/null) + dev2=$(stat $formatarg %d $dir/.. 2>/dev/null) if [[ $dev1 == $dev2 ]]; then rv=1 else