-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Convenience functions that use HSH, instances for HSH. -- -- Functions I found I was using repeatedly when doing shell programming -- with HSH. Rather than duplicate code, released on hackage. @package HSHHelpers @version 0.21 module HSH.Helpers.Utils inPath :: FilePath -> ErrorT String IO () tryS :: IO a -> IO (Either String a) module HSH.Helpers.Email newtype PureInput PureInput :: String -> PureInput unpureinput :: PureInput -> String -- | Send an email via mailx. -- -- For sysadmin steps required for this command to work with most of the -- work outsourced to gmail, see last three posts in thread -- -- -- http:groups.google.comgroupHAppSbrowse_threadthread93317d4d7317040f14cd89d98f1f4041 -- -- This assumes a unixy environment, mailxEmail :: String -> String -> [Char] -> IO (Either String ()) instance Read PureInput instance Show PureInput module HSH.Helpers.UnixUsers isSystemUser :: SysUser -> IO Bool isSystemGroup :: SysGroup -> IO Bool isSysGroupMember :: SysUser -> SysGroup -> IO Bool systemUsers :: IO [SysUser] systemGroups :: IO [SysGroup] getSysGroupPrimary :: SysUser -> IO SysGroup getSysGroupsSecondary :: SysUser -> IO [SysGroup] getSysGroupsAll :: SysUser -> IO [SysGroup] groupadd :: SysGroup -> IO (Either String ()) groupdel :: SysGroup -> IO (Either String ()) userdel :: SysUser -> IO (Either String ()) useradd :: SysUser -> (Maybe SysGroup) -> (Maybe SysShell) -> (Maybe SysHomedir) -> IO (Either String ()) addUserToGroup :: SysUser -> SysGroup -> IO (Either String ()) rmUserFromGroup :: SysUser -> SysGroup -> IO (Either String ()) chown :: (Maybe SysUser) -> (Maybe SysGroup) -> Recurse -> FilePath -> IO (Either String ()) chmod :: ChmodAddDelEq -> ChmodRole -> ChmodPerm -> Recurse -> FilePath -> IO (Either String ()) data ChmodAddDelEq ChmodAdd :: ChmodAddDelEq ChmodDel :: ChmodAddDelEq ChmodEq :: ChmodAddDelEq data ChmodRole ChmodU :: ChmodRole ChmodG :: ChmodRole ChmodO :: ChmodRole ChmodUG :: ChmodRole ChmodUO :: ChmodRole ChmodGO :: ChmodRole ChmodUGO :: ChmodRole data ChmodPerm ChmodR :: ChmodPerm ChmodW :: ChmodPerm ChmodX :: ChmodPerm ChmodRW :: ChmodPerm ChmodRX :: ChmodPerm ChmodWX :: ChmodPerm ChmodRWX :: ChmodPerm newtype SysUser SysUser :: String -> SysUser unsysuser :: SysUser -> String newtype SysGroup SysGroup :: String -> SysGroup unsysgroup :: SysGroup -> String newtype SysShell SysShell :: String -> SysShell unsysshell :: SysShell -> String newtype SysHomedir SysHomedir :: String -> SysHomedir unsyshomedir :: SysHomedir -> String newtype Recurse Recurse :: Bool -> Recurse unrecures :: Recurse -> Bool instance Read Recurse instance Show Recurse instance Eq Recurse instance Read SysHomedir instance Show SysHomedir instance Eq SysHomedir instance Read SysShell instance Show SysShell instance Eq SysShell instance Read SysGroup instance Show SysGroup instance Eq SysGroup instance Read SysUser instance Show SysUser instance Eq SysUser module HSH.Helpers.FileManip data SymlinkArgs SymLinkArgs :: String -> String -> SymlinkArgs target :: SymlinkArgs -> String link :: SymlinkArgs -> String -- | wrapper over find /path/to/top/dir -type d findDirectories :: FilePath -> IO [FilePath] runS :: String -> IO String runStrings :: String -> IO [String] instance Show SymlinkArgs module HSH.Helpers.Instances -- | Evaluates result codes and raises an error for any bad ones it finds. checkProcessStatus :: (String, ProcessStatus) -> IO (Either String ()) data CWDCommand CWDCommand :: String -> String -> CWDCommand cwdDir :: CWDCommand -> String cwdCmd :: CWDCommand -> String -- | runCD dir command | useful alternative to bracketCD where bracketCD -- has the wrong behavior due to lazy IO | note, not a drop in -- replacement to bracketCD because you specify an actual shell command, -- not arbitrary IO runCD :: FilePath -> String -> IO () t :: IO () instance Read CWDCommand instance Show CWDCommand instance ShellCommand CWDCommand instance RunResult (IO (Either String ())) module HSH.Helpers