diff --git a/ssh.go b/ssh.go index ed7f553..d5ce94f 100644 --- a/ssh.go +++ b/ssh.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "os" "golang.org/x/crypto/ssh" ) @@ -91,12 +92,13 @@ func (s SSHConnection) openSession(client SSHClients) SSHSessions { func (s SSHConnection) executeSFTP(execute SSHClients) SSHSFTP { // execute order 66 lol sftp := SSHSFTP{} + homedir := os.Getenv("HOME") for _, j := range execute { // TODO: this is just a placeholder, change to the actual tarring executable getFile(j) - err := gzipit("/home/wyatt/"+filename, ".") + err := gzipit(homedir+filename, ".") if err != nil { fmt.Errorf("Cannot gzip file(s)", err) diff --git a/todo.md b/todo.md index 4fa229e..4471f18 100644 --- a/todo.md +++ b/todo.md @@ -3,4 +3,5 @@ - Allow having SSH keys and passwordless SSH sessions, along with having bypassing keys altogether - Allow fetching of multiple log files (fields under the defined host? Seperate key/field? Dynamic?) - Allow different machines to collect different log files -- Allow to gather directories of log files \ No newline at end of file +- Allow to gather directories of log files +- Develop a log getting logs for sanity \ No newline at end of file