changed log output regarding empty password
This commit is contained in:
parent
9ef9354b68
commit
5eab61d350
2 changed files with 4 additions and 5 deletions
5
main.go
5
main.go
|
@ -14,7 +14,10 @@ func main() {
|
|||
log.Info("starting gosync...")
|
||||
error := tools.TestConnection()
|
||||
if error != nil {
|
||||
log.Fatal("encountered an error connecting to the remove target", error.Error())
|
||||
if len(settings.Password) == 0 {
|
||||
log.Warning("could not connect to the remote target, make sure passwordless login is configured or supply a password")
|
||||
}
|
||||
log.Fatal("encountered an error connecting to the remote target", error.Error())
|
||||
}
|
||||
tools.Transfer()
|
||||
exit(timestamp, 0)
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
|
||||
"os/exec"
|
||||
"strings"
|
||||
"velvettear/gosync/log"
|
||||
"velvettear/gosync/settings"
|
||||
)
|
||||
|
||||
|
@ -15,9 +14,6 @@ func TestConnection() error {
|
|||
if !settings.TargetIsRemote() {
|
||||
return nil
|
||||
}
|
||||
if len(settings.Password) == 0 {
|
||||
log.Warning("target is a remote host and no password is set, make sure passwordless login is configured")
|
||||
}
|
||||
var arguments []string
|
||||
if len(settings.Password) > 0 {
|
||||
arguments = append(arguments, "-p", settings.Password)
|
||||
|
|
Loading…
Reference in a new issue