This commit is contained in:
henrik
2021-03-17 16:01:19 +01:00
parent 617d7834cc
commit 27dec52bf7
4 changed files with 5 additions and 23 deletions

View File

@@ -24,11 +24,6 @@ func Run(ctx context.Context) {
log.Fatalf("EntryGroupNew() failed: %v", err)
}
//hostname, err := a.GetHostName()
if err != nil {
log.Fatalf("GetHostName() failed: %v", err)
}
fqdn, err := a.GetHostNameFqdn()
if err != nil {
log.Fatalf("GetHostNameFqdn() failed: %v", err)
@@ -36,11 +31,11 @@ func Run(ctx context.Context) {
var txt [][]byte
txt = append(txt, []byte("note=burken"))
txt = append(txt, []byte("product=coola-skrivaren"))
txt = append(txt, []byte("product=ChroBroPrint V1"))
txt = append(txt, []byte("Color=T"))
txt = append(txt, []byte("rp=ipp/print"))
txt = append(txt, []byte("ty=ChroBro 001"))
err = eg.AddService(avahi.InterfaceUnspec, avahi.ProtoUnspec, 0, "ChroBro 1000", "_ipp._tcp", "local", fqdn, 1234, txt)
txt = append(txt, []byte("ty=ChroBroPrint"))
err = eg.AddService(avahi.InterfaceUnspec, avahi.ProtoUnspec, 0, "ChroBroPrint", "_ipp._tcp", "local", fqdn, 1234, txt)
if err != nil {
log.Fatalf("AddService() failed: %v", err)
}