Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
qu35t-code committed Jan 27, 2024
1 parent ff01f6b commit bdf9a59
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ func GetUserFlag(connection *ssh.Client) (string, error) {
}
cmd := fmt.Sprintf("if [ -f %s ]; then echo found; else echo not found; fi", filePath)
fileOutput, err := fileSession.CombinedOutput(cmd)
if err != nil {
return "", err
}
fileSession.Close()

if strings.TrimSpace(string(fileOutput)) == "found" {
Expand Down Expand Up @@ -108,6 +111,9 @@ func GetHostname(connection *ssh.Client) (string, error) {
}
cmd := "hostname"
sessionOutput, err := hostnameSession.CombinedOutput(cmd)
if err != nil {
return "", err
}
hostnameSession.Close()
hostname := strings.ReplaceAll(string(sessionOutput), "\n", "")
config.GlobalConfig.Logger.Debug(fmt.Sprintf("Hotname: %s", hostname))
Expand Down

0 comments on commit bdf9a59

Please sign in to comment.