summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-08-13 15:35:53 -0400
committerAndrew Cady <d@jerkface.net>2023-08-13 15:35:53 -0400
commitaaba4052a7a515279b5a984c3ca0f035e8dda7f2 (patch)
tree04325ef7ea4b75044cee222ee16f79df7b31d17a
parent26411378369fdccd14dbfa3a5209aa35c298bce8 (diff)
fix for when root subvolume is not /
-rwxr-xr-xlist-all-subvolumes11
1 files changed, 7 insertions, 4 deletions
diff --git a/list-all-subvolumes b/list-all-subvolumes
index fc19b69..d438832 100755
--- a/list-all-subvolumes
+++ b/list-all-subvolumes
@@ -39,16 +39,19 @@ extract_subvolume_path()
39 then 39 then
40 root=${tryroot#$1/} 40 root=${tryroot#$1/}
41 break 41 break
42 elif [ "$tryroot" = / ] 42 elif [ ! "$tryroot" -o "$tryroot" = / ]
43 then 43 then
44 break 44 break
45 else 45 else
46 tryroot=${tryroot%/*} 46 tryroot=${tryroot%/*}
47 fi 47 fi
48 done 48 done
49 case "$path" in 49 if [ "$root" ]
50 "$root" | "$root"/*) path=$root/.${path#$root} ;; 50 then
51 esac 51 case "$path" in
52 "$root" | "$root"/*) path=$root/.${path#$root} ;;
53 esac
54 fi
52 printf '%s//%s\n' "${1##*/}" "$path" 55 printf '%s//%s\n' "${1##*/}" "$path"
53 done 56 done
54} 57}