From c53a3e80170dc9d45beeeb623edfbf0bd40799a7 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Tue, 7 Mar 2017 19:55:05 +0100 Subject: lib/archroot.sh: Add is_btrfs helper --- lib/archroot.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib') 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 ]] +} -- cgit v1.2.3-54-g00ecf