diff --git a/main.go b/main.go index b3b4bdd..4d7b5f3 100644 --- a/main.go +++ b/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) diff --git a/tools/ssh.go b/tools/ssh.go index bff65f3..84aabae 100644 --- a/tools/ssh.go +++ b/tools/ssh.go @@ -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)