added an env variable
Added an environment variable for the home directory so we don't have to hardcode it or enter it inside a config file
This commit is contained in:
parent
e766f580bb
commit
5afa2c0f9a
4
ssh.go
4
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)
|
||||
|
Loading…
Reference in New Issue
Block a user