From d2393d8141ac302eff5dc29d32d68014b630d166 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 2 Sep 2015 11:13:36 -0700 Subject: propellor spin --- src/Propellor/Property/Mount.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Propellor/Property/Mount.hs') diff --git a/src/Propellor/Property/Mount.hs b/src/Propellor/Property/Mount.hs index 43ca0cc6..4070ebcb 100644 --- a/src/Propellor/Property/Mount.hs +++ b/src/Propellor/Property/Mount.hs @@ -29,6 +29,12 @@ umountLazy mnt = unlessM (boolSystem "umount" [ Param "-l", Param mnt ]) $ errorMessage $ "failed unmounting " ++ mnt +-- | Unmounts anything mounted inside the specified directory. +unmountBelow :: FilePath -> IO () +unmountBelow d = do + submnts <- mountPointsBelow d + forM_ submnts umountLazy + -- | Mounts a device. mount :: FsType -> Source -> FilePath -> IO Bool mount fs src mnt = boolSystem "mount" [Param "-t", Param fs, Param src, Param mnt] -- cgit v1.2.3