diff --git a/functions.sh b/functions.sh index bf4df6f..7994715 100755 --- a/functions.sh +++ b/functions.sh @@ -1055,7 +1055,14 @@ get_crtime() { is_btrfs_subvolume() { - sudo btrfs subvolume show "$1" >/dev/null + local XSUDO + if [ $(id -u) -eq 0 ] + then + XSUDO= + else + XSUDO=sudo + fi + ${XSUDO:+sudo} btrfs subvolume show "$1" >/dev/null } convert_to_subvolume () {