Documentation
¶
Index ¶
- func AllowError(errString string, command string, args ...string) (bool, error)
- func CommandOutputOrPanic(command string, args ...string) string
- func Error(c *exec.Cmd) ([]byte, error)
- func GeneratePassword() string
- func ProcessCommandOutput(lineEnding string, callback func(line string), prog string, options ...string) error
- func RunCommands(allowFail bool, commands ...[]string) error
- type OSUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowError ¶
Runs command `command` with arguments `args`. If standard error from command includes `errString` then true, is returned with no error. Otherwise false is returned, with or without an error.
func CommandOutputOrPanic ¶
func GeneratePassword ¶
func GeneratePassword() string
Uses [A-Za-z0-9] characters (default set) to avoid strange escaping problems that could potentially affect security. Prefixed with `pWd0_` to ensure password contains a special character (_), lowercase and uppercase letters, and a number. This is useful if the OS has a strict password policy requiring all of these. The total password length is 29 characters (24 of which are random). 29 characters should not be too long for the OS. The 24 random characters of [A-Za-z0-9] provide (26+26+10)^24 possible permutations (approx 143 bits of randomness). Randomisation is not seeded, so results should not be reproducible.