X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/e55ecb6c4a75d1d16b6785dbe9f75f9e22291a21..e1f6476cdee99a9ec2f7e2cc3c4ad1bba5247e4d:/cmd/mobius-hotline-server/main.go diff --git a/cmd/mobius-hotline-server/main.go b/cmd/mobius-hotline-server/main.go index 4fa28c2..2bda39b 100644 --- a/cmd/mobius-hotline-server/main.go +++ b/cmd/mobius-hotline-server/main.go @@ -43,7 +43,8 @@ func main() { // } // }() - basePort := flag.Int("bind", defaultPort, "Bind address and port") + netInterface := flag.String("interface", "", "IP addr of interface to listen on. Defaults to all interfaces.") + basePort := flag.Int("bind", defaultPort, "Base Hotline server port. File transfer port is base port + 1.") statsPort := flag.String("stats-port", "", "Enable stats HTTP endpoint on address and port") configDir := flag.String("config", defaultConfigPath(), "Path to config root") version := flag.Bool("version", false, "print version and exit") @@ -87,7 +88,6 @@ func main() { logger.Fatal(err) } logger.Infow("Config dir initialized at " + *configDir) - } else { logger.Infow("Existing config dir found. Skipping initialization.") } @@ -97,7 +97,7 @@ func main() { logger.Fatalw("Configuration directory not found. Correct the path or re-run with -init to generate initial config.", "path", configDir) } - srv, err := hotline.NewServer(*configDir, *basePort, logger, &hotline.OSFileStore{}) + srv, err := hotline.NewServer(*configDir, *netInterface, *basePort, logger, &hotline.OSFileStore{}) if err != nil { logger.Fatal(err) } @@ -182,7 +182,7 @@ func defaultConfigPath() (cfgPath string) { case "linux": cfgPath = "/usr/local/var/mobius/config/" default: - fmt.Printf("unsupported OS") + cfgPath = "./config/" } return cfgPath @@ -232,7 +232,6 @@ func copyDir(src, dst string) error { } f.Close() } - } return nil