changed log output regarding empty password

This commit is contained in:
Daniel Sommer 2023-09-07 15:51:53 +02:00
parent 9ef9354b68
commit 5eab61d350
2 changed files with 4 additions and 5 deletions

View file

@ -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)

View file

@ -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)