]> git.ipfire.org Git - people/ms/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 19:39:17 +0000 (20:39 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 2 Apr 2024 19:25:00 +0000 (19:25 +0000)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
src/initscripts/system/functions

index 5a26aef45f843b55b95e628dbc93111a412b425f..b610143ab11eceebcc329fa2773c45035db9ed8a 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
+
+       stat -f --format="%T" ${1}
+}