diff --git a/.DS_Store b/.DS_Store index 915c486..f343718 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/simply-ssh/main.go b/simply-ssh/main.go index 77f7fe5..243d7a4 100644 --- a/simply-ssh/main.go +++ b/simply-ssh/main.go @@ -255,3 +255,15 @@ func DownloadFile(sftpClient *sftp.Client, remoteFilePath, localFilePath string) fmt.Println("\nTéléchargement terminé:", localFilePath) return nil } +func ExecuteCommand(command string,session *ssh.Session){ + // initialisation du buffer pour recupere les infos reçu de l' hôte + var b bytes.Buffer + session.Stdout = &b + if err := session.Run(command); err != nil { + fmt.Println(b) + log.Fatal("Failed cmd: ", err) + + } + fmt.Println(b) + +} \ No newline at end of file