auto add exit  cmd
This commit is contained in:
Feng_Qi 2018-01-05 13:28:08 +08:00
parent cddaeaaf8d
commit 3b1a46e4e0
4 changed files with 4 additions and 5 deletions

View file

@ -1,2 +1 @@
show clock show clock
exit

View file

@ -1,4 +1,3 @@
date date
sleep 3 sleep 3
date date
exit

View file

@ -12,7 +12,7 @@ import (
) )
const ( const (
VERSION = "0.1.1" VERSION = "0.1.2"
) )
type SSHHost struct { type SSHHost struct {

View file

@ -74,6 +74,7 @@ func dossh(username, password, ip string, cmdlist []string, port int, ch chan st
} }
defer session.Close() defer session.Close()
cmdlist = append(cmdlist, "exit")
// cmd := "ls;date;exit" // cmd := "ls;date;exit"
stdinBuf, _ := session.StdinPipe() stdinBuf, _ := session.StdinPipe()
//fmt.Fprintf(os.Stdout, "%s", stdinBuf) //fmt.Fprintf(os.Stdout, "%s", stdinBuf)