summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/archroot.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/archroot.sh b/lib/archroot.sh
index 7d7ab67..14417aa 100644
--- a/lib/archroot.sh
+++ b/lib/archroot.sh
@@ -12,3 +12,11 @@ check_root() {
exec su root -c "$(printf ' %q' "${orig_argv[@]}")"
fi
}
+
+##
+# usage : is_btrfs( $path )
+# return : whether $path is on a btrfs
+##
+is_btrfs() {
+ [[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs ]]
+}