From 31ad152b7016f44dedafd16bdda01e7f06cbbc0c Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Wed, 27 Mar 2024 05:51:56 +0100 Subject: [PATCH] initscripts: Add generic function to get the filesystem type of a volume Signed-off-by: Stefan Schantl --- src/initscripts/system/functions | 8 ++++++++ 1 file changed, 8 insertions(+) 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})" +} -- 2.39.5