summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Mount.hs
diff options
context:
space:
mode:
authorJoey Hess2014-12-04 16:50:00 -0400
committerJoey Hess2014-12-04 16:50:00 -0400
commitbf4840f341c83f28a53cf80fd7750a661e734d65 (patch)
tree3376f3825fe1ea1db9352357dc6a577b9429c0d7 /src/Propellor/Property/Mount.hs
parente47fbd9b39708e3488e047a5c22565ff23e79d46 (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Mount.hs')
-rw-r--r--src/Propellor/Property/Mount.hs12
1 files changed, 12 insertions, 0 deletions
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