(user string)
| 121 | } |
| 122 | |
| 123 | func (c *SSHClient) IsRoot(user string) bool { |
| 124 | if user == "root" { |
| 125 | return true |
| 126 | } |
| 127 | _, err := c.Run("sudo -n true") |
| 128 | return err == nil |
| 129 | } |
| 130 | |
| 131 | func (c *SSHClient) Runf(shell string, args ...interface{}) (string, error) { |
| 132 | shell = c.SudoItem + " " + shell |