From 3b1a46e4e00f29a5ce6c2e114a64040526b6eb5c Mon Sep 17 00:00:00 2001 From: Feng_Qi Date: Fri, 5 Jan 2018 13:28:08 +0800 Subject: [PATCH] 0.1.2 auto add exit cmd --- cmd1.txt.example | 3 +-- cmd2.txt.example | 3 +-- main.go | 2 +- sshconnect.go | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd1.txt.example b/cmd1.txt.example index f61b2a7..f58a975 100644 --- a/cmd1.txt.example +++ b/cmd1.txt.example @@ -1,2 +1 @@ -show clock -exit \ No newline at end of file +show clock \ No newline at end of file diff --git a/cmd2.txt.example b/cmd2.txt.example index 12a5f15..341974a 100644 --- a/cmd2.txt.example +++ b/cmd2.txt.example @@ -1,4 +1,3 @@ date sleep 3 -date -exit \ No newline at end of file +date \ No newline at end of file diff --git a/main.go b/main.go index ffdb520..8390fb6 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ import ( ) const ( - VERSION = "0.1.1" + VERSION = "0.1.2" ) type SSHHost struct { diff --git a/sshconnect.go b/sshconnect.go index 8e0c4c9..1962557 100644 --- a/sshconnect.go +++ b/sshconnect.go @@ -74,6 +74,7 @@ func dossh(username, password, ip string, cmdlist []string, port int, ch chan st } defer session.Close() + cmdlist = append(cmdlist, "exit") // cmd := "ls;date;exit" stdinBuf, _ := session.StdinPipe() //fmt.Fprintf(os.Stdout, "%s", stdinBuf)