Lines Matching defs:cmd
41 func RunCmdViaSSHContext(ctx context.Context, addr string, user string, passwd string, cmd string) (err error) {
44 if err := RunCmdViaSSHContextNoRetry(ctx, addr, user, passwd, cmd); err != nil {
48 logrus.Errorf("exec cmd via SSH at %s failed: %v, try again...", addr, err)
49 return RunCmdViaSSHContextNoRetry(ctx, addr, user, passwd, cmd)
54 func RunCmdViaSSHContextNoRetry(ctx context.Context, addr string, user string, passwd string, cmd string) (err error) {
81 logrus.Infof("run at %s: %s", addr, cmd)
98 cmd = fmt.Sprintf("%s\nexit $?\n", cmd)
99 go stdin.Write([]byte(cmd))
102 fmt.Printf("[%s] exec at %s %s :\n", time.Now(), addr, cmd)