X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-utils%2Favahi-publish-service.in;h=0f278eba66a09ac9b54205157191513f500a5132;hb=7dfbaa097e99373e6eec03f07c43c046b94481f8;hp=89c1566195dd875bf527fce7c014042039209656;hpb=d76069e946b4e89c828c96340677e40f583080c9;p=catta diff --git a/avahi-utils/avahi-publish-service.in b/avahi-utils/avahi-publish-service.in index 89c1566..0f278eb 100755 --- a/avahi-utils/avahi-publish-service.in +++ b/avahi-utils/avahi-publish-service.in @@ -40,9 +40,9 @@ def usage(retval = 0): sys.exit(retval) try: - opts, args = getopt.getopt(sys.argv[1:], "d:H:", ["help", "domain=", "host="]) + opts, args = getopt.getopt(sys.argv[1:], "hd:H:", ["help", "domain=", "host="]) except getopt.GetoptError: - pass + usage(2) domain = "" host = "" @@ -88,7 +88,8 @@ def add_service(): print "Adding service '%s' of type '%s' ..." % (name, stype) group.connect_to_signal('StateChanged', entry_group_state_changed) - group.AddService(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, name, stype, domain, host, dbus.UInt16(port), txt) + + group.AddService(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, name, stype, domain, host, dbus.UInt16(port), avahi.string_array_to_txt_array(txt)) group.Commit() def entry_group_state_changed(state):