This commit is contained in:
Rob Pearce 2022-01-23 15:52:42 +11:00
commit 307948c272
1 changed files with 10 additions and 3 deletions

13
bare.sh
View File

@ -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