def main():
    with open("config.json", "r") as config_file:
        cfg = json.load(config_file)

    cc = cryptocore.CryptoCore()
    print("Hi.")
    print("My tox3 public key is {0}.".format(cc.public_key))

    if "pid_file" in cfg:
        with open(cfg["pid_file"], "w") as pid:
            pid.write(str(os.getpid()))

    try:
        server = make_server(cc, cfg)
        if "suid" in cfg:
            print("SUID...")
            if os.getuid() == 0:
                if ":" not in cfg["suid"]:
                    user = cfg["suid"]
                    group = None
                else:
                    user, group = cfg["suid"].split(":", 1)
                uid = pwd.getpwnam(user).pw_uid
                if group:
                    gid = grp.getgrnam(group).gr_gid
                else:
                    gid = pwd.getpwnam(user).pw_gid
                os.setgid(gid)
                os.setuid(uid)
            else:
                print("error: we're not root. Exiting.")
                sys.exit()
        server.start()
    finally:
        os.remove(cfg["pid_file"])
dataset/ETHPy150Open stal888/Tox-QuickDNS/yuu-lite.py/main/original