From: Stefan Schantl Date: Wed, 27 Mar 2024 04:51:56 +0000 (+0100) Subject: initscripts: Add generic function to get the filesystem type of a volume X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=31ad152b7016f44dedafd16bdda01e7f06cbbc0c;p=people%2Fstevee%2Fipfire-2.x.git initscripts: Add generic function to get the filesystem type of a volume Signed-off-by: Stefan Schantl --- diff --git a/src/initscripts/system/functions b/src/initscripts/system/functions index 5a26aef45..0fa825000 100644 --- a/src/initscripts/system/functions +++ b/src/initscripts/system/functions @@ -883,3 +883,11 @@ running_on_oci() { # We are not running on OCI return 1 } + +volume_fs_type() { + if [ ! -d "${1}" ]; then + return + fi + + echo "$(stat -f --format="%T" ${1})" +}