Beispiel #1
0
 def create_nameserver(self, host="localhost", passw=False):
     try:
         if ("localhost" in host):  # Private NS
             self.priv_ready = True
             print(colored("Started private name server.", 'yellow'))
             self.priv_nameserver = nm.startNSloop(host=host,
                                                   hmac=bytes(passw))
         else:  # Public NS
             print(colored("Started public name server.", 'yellow'))
             self.pub_nameserver = nm.startNSloop(host=host)
     except Exception:
         print("Error al crear el nameserver %s" % host)
Beispiel #2
0
 def create_nameserver(self, host="localhost", passw=False):
     """Thread-1 loop for nameserver"""
     try:
         if "localhost" in host:  # Private NS
             self.priv_ready = True
             print(colored("Started private name server.", 'yellow'))
             self.priv_nameserver = nm.startNSloop(host=host,
                                                   hmac=passw.encode())
         else:  # Public NS
             print(colored("Started public name server.", 'yellow'))
             self.pub_nameserver = nm.startNSloop(host=host)
     except Exception:
         print("Error al crear el nameserver %s" % host)
Beispiel #3
0
def qanameserverd(argv):
    import getopt
    do_daemon = True
    try:
        optlist, args = getopt.getopt(argv[1:], "nh?")
    except getopt.GetoptError:
        print(_DOC)
        sys.exit(2)

    for opt, optarg in optlist:
        if opt in ("-h", "-?"):
            print(_DOC)
            return
        elif opt == "-n":
            do_daemon = False

    if do_daemon:
        from pycopia import daemonize
        daemonize.daemonize()

    naming.startNSloop()
Beispiel #4
0
def qanameserverd(argv):
    import getopt
    do_daemon = True
    try:
        optlist, args = getopt.getopt(argv[1:], "nh?")
    except getopt.GetoptError:
        print(_DOC)
        sys.exit(2)

    for opt, optarg in optlist:
        if opt in ("-h", "-?"):
            print(_DOC)
            return
        elif opt == "-n":
            do_daemon = False

    if do_daemon:
        from pycopia import daemonize
        daemonize.daemonize()

    naming.startNSloop()