summaryrefslogtreecommitdiffstats
path: root/lib/archroot.sh
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2017-03-07 19:55:05 +0100
committerJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2017-03-07 20:37:54 +0100
commitc53a3e80170dc9d45beeeb623edfbf0bd40799a7 (patch)
tree6cbeab8af72dfa40a7c445817fe208583df7e872 /lib/archroot.sh
parent45f87aa9d5b44e4ff2f73be6597d4024bcded8e3 (diff)
downloaddevtools-c53a3e80170dc9d45beeeb623edfbf0bd40799a7.tar.gz
devtools-c53a3e80170dc9d45beeeb623edfbf0bd40799a7.tar.xz
lib/archroot.sh: Add is_btrfs helper
Diffstat (limited to 'lib/archroot.sh')
-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 ]]
+}