From: Stefan Schantl Date: Wed, 27 Mar 2024 19:39:17 +0000 (+0100) Subject: initscripts: Add generic function to get the filesystem type of a volume X-Git-Tag: v2.29-core186~124 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed91103e229b128288a9799a9bbbbe6cd1d7f32d;p=ipfire-2.x.git initscripts: Add generic function to get the filesystem type of a volume Signed-off-by: Stefan Schantl Reviewed-by: Michael Tremer Signed-off-by: Arne Fitzenreiter --- diff --git a/src/initscripts/system/functions b/src/initscripts/system/functions index 5a26aef45f..b610143ab1 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 + + stat -f --format="%T" ${1} +}