Added support for changing mdns name

+ Added `mdnsname` startup flag
This commit is contained in:
Toby Chui
2024-04-30 11:49:34 +08:00
parent e24f31bdef
commit 7ba997dfc2
2 changed files with 11 additions and 1 deletions

View File

@@ -160,8 +160,17 @@ func startupSequence() {
if err != nil {
portInt = 8000
}
hostName := *mdnsName
if hostName == "" {
hostName = "zoraxy_" + nodeUUID
} else {
//Trim off the suffix
hostName = strings.TrimSuffix(hostName, ".local")
}
mdnsScanner, err = mdns.NewMDNS(mdns.NetworkHost{
HostName: "zoraxy_" + nodeUUID,
HostName: hostName,
Port: portInt,
Domain: "zoraxy.arozos.com",
Model: "Network Gateway",