Update ZfsDevices.hs
This commit is contained in:
parent
382943544e
commit
c4ceaadd15
1 changed files with 9 additions and 9 deletions
|
|
@ -4,26 +4,26 @@ import System.Zfs.Zpool
|
|||
import System.Zfs.Types
|
||||
import System.Zfs
|
||||
import Control.Monad.IO.Class
|
||||
import System.Process (callCommand)
|
||||
|
||||
|
||||
{-
|
||||
zfs functions can only be accessed throught the zfs monad.
|
||||
-}
|
||||
main' :: Zfs ()
|
||||
main' = do
|
||||
|
||||
|
||||
forZpools_ $ \zpool -> do
|
||||
our_pools <- getZpools
|
||||
nm <- getZpoolName zpool
|
||||
-- effects also must be done within the zfs monad
|
||||
liftIO $ putStrLn ("Pool: "++nm)
|
||||
vdevs <- getVdevs zpool
|
||||
liftIO $ print vdevs
|
||||
liftIO $ print vdevs
|
||||
enableDatasets zpool ""
|
||||
liftIO $ putStrLn "Mounting..."
|
||||
return ()
|
||||
|
||||
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
-- and you can only run the zfs monad using the "runZfs" function
|
||||
|
||||
callCommand "zpool import -a" -- should make a ffi function for it
|
||||
res <- runZfs main'
|
||||
case res of
|
||||
Left e -> print e
|
||||
|
|
|
|||
Loading…
Reference in a new issue