gosync/main.go

32 lines
707 B
Go
Raw Normal View History

2023-09-07 15:20:19 +02:00
package main
import (
"os"
"time"
"velvettear/gosync/log"
"velvettear/gosync/settings"
"velvettear/gosync/tools"
)
// version := "0.1"
2023-09-07 15:20:19 +02:00
func main() {
timestamp := time.Now()
settings.Initialize()
log.Info("starting gosync...")
error := tools.TestConnection()
if error != nil {
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())
2023-09-07 15:20:19 +02:00
}
tools.Transfer()
exit(timestamp, 0)
}
func exit(timestamp time.Time, code int) {
log.InfoTimed("gosync finished - exiting...", timestamp.UnixMilli())
os.Exit(code)
}