]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
initscripts: Add generic function to get the filesystem type of a volume
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 27 Mar 2024 04:51:56 +0000 (05:51 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Wed, 27 Mar 2024 04:51:56 +0000 (05:51 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
src/initscripts/system/functions

index 5a26aef45f843b55b95e628dbc93111a412b425f..0fa825000b80caba437ec62dd6bc47a8eff2e8cc 100644 (file)
@@ -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})"
+}