From bf4840f341c83f28a53cf80fd7750a661e734d65 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 Dec 2014 16:50:00 -0400 Subject: propellor spin --- src/Propellor/Property/Mount.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/Propellor/Property/Mount.hs (limited to 'src/Propellor/Property/Mount.hs') diff --git a/src/Propellor/Property/Mount.hs b/src/Propellor/Property/Mount.hs new file mode 100644 index 00000000..804407e9 --- /dev/null +++ b/src/Propellor/Property/Mount.hs @@ -0,0 +1,12 @@ +module Propellor.Property.Mount where + +import Propellor +import Utility.SafeCommand + +mountPoints :: IO [FilePath] +mountPoints = lines <$> readProcess "findmnt" ["-rn", "--output", "target"] + +umountLazy :: FilePath -> IO () +umountLazy mnt = + unlessM (boolSystem "umount" [ Param "-l", Param mnt ]) $ + errorMessage $ "failed unmounting " ++ mnt -- cgit v1.3-2-g0d8e