diff --git a/TCPClient.go b/TCPClient.go index 61c5a37..dfa0fee 100644 --- a/TCPClient.go +++ b/TCPClient.go @@ -40,6 +40,7 @@ func NewTCPClient(TCPServer *TCPServer, Countries Countries) *TCPClient { Address: Cfg.Cluster.Server, Port: Cfg.Cluster.Port, Login: Cfg.Cluster.Login, + Password: Cfg.Cluster.Password, MsgChan: TCPServer.MsgChan, CmdChan: TCPServer.CmdChan, SpotChanToFlex: make(chan TelnetSpot, 100), @@ -149,13 +150,14 @@ func (c *TCPClient) ReadLine() { if strings.Contains(message, Cfg.Cluster.LoginPrompt) { Log.Debug("Found login prompt...sending callsign") c.Write([]byte(c.Login + "\r\n")) - c.SetFilters() - if Cfg.Cluster.Command != "" { - c.WriteString(Cfg.Cluster.Command + "\n\r") - } + c.LoggedIn = true + // c.SetFilters() + // if Cfg.Cluster.Command != "" { + // c.WriteString(Cfg.Cluster.Command + "\n\r") + // } Log.Infof("Connected to cluster %s", Cfg.Cluster.Server) Log.Info("Start receiving spots") - c.LoggedIn = true + continue } } @@ -164,6 +166,11 @@ func (c *TCPClient) ReadLine() { message, _ = strings.CutSuffix(message, "\n") message, _ = strings.CutSuffix(message, "\r") + if strings.Contains(message, "password") { + Log.Debug("Found password prompt...sending password") + c.Write([]byte(c.Password + "\r\n")) + } + if err != nil { Log.Errorf("Error reading message: %s", err) c.Conn.Close() diff --git a/config.go b/config.go index 25ad805..ed469f9 100644 --- a/config.go +++ b/config.go @@ -27,6 +27,7 @@ type Config struct { Server string `yaml:"server"` Port string `yaml:"port"` Login string `yaml:"login"` + Password string `yaml:"password"` Skimmer bool `yaml:"skimmer"` FT8 bool `yaml:"ft8"` FT4 bool `yaml:"ft4"` diff --git a/config.yml b/config.yml index e674cd9..8865d0a 100644 --- a/config.yml +++ b/config.yml @@ -8,13 +8,14 @@ sqlite: sqlite_path: 'C:\Perso\Seafile\Radio\Logs\Log4OM\F4BPO.SQLite' # SQLite Db oath of Log4OM callsign: F4BPO # Log4OM Callsign used to check if you get spotted by someone cluster: - server: dxc.sm7iun.se # dxc.k0xm.net - port: 23 + server: cluster.f4bpo.com # dxc.k0xm.net dxc.sm7iun.se + port: 7300 login: f4bpo + password: 89DGgg skimmer: true ft8: false ft4: false - command: SET/NOFILTER + command: login_prompt: "login:" flex: discovery: true # Radio must be on same LAN than the program diff --git a/main.go b/main.go index cc19f5f..3d31420 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,7 @@ func main() { cfg := NewConfig(cfgPath) log := NewLog() - log.Info("Running FlexDXCluster version 0.3") + log.Info("Running FlexDXCluster version 0.4") log.Infof("Callsign: %s", cfg.SQLite.Callsign) DeleteDatabase("./flex.sqlite", log)