diff options
author | Brian Sherson <caretaker82@euclid.shersonb.net> | 2013-12-04 01:35:44 -0800 |
---|---|---|
committer | Brian Sherson <caretaker82@euclid.shersonb.net> | 2013-12-04 01:35:44 -0800 |
commit | 0d802dab5b586d511a6291248702c910502acaf7 (patch) | |
tree | f370db15b1a29c2fa8b6699188d28923b1361462 /startirc.py | |
parent | 5cf8d2185f89aaf30e856bd0dbca88fbb51789ba (diff) |
Significant changes
Diffstat (limited to 'startirc.py')
-rwxr-xr-x | startirc.py | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/startirc.py b/startirc.py index 554c6b3..c3a6cec 100755 --- a/startirc.py +++ b/startirc.py @@ -20,21 +20,21 @@ networks = {} def quit(quitmsg="Goodbye!"): global networks - modules = [] + addons = [] for IRC in networks.values(): if IRC.isAlive(): IRC.quit(quitmsg) while any([IRC.isAlive() for IRC in networks.values()]): time.sleep(0.25) for IRC in networks.values(): - for module in list(IRC.modules): - IRC.rmModule(module) - if module not in modules: - modules.append(module) - for module in modules: - if "stop" in dir(module) and callable(module.stop) and "isAlive" in dir(module) and callable(module.isAlive) and module.isAlive(): + for addon in list(IRC.addons): + IRC.rmAddon(addon) + if addon not in addons: + addons.append(addon) + for addon in addons: + if "stop" in dir(addon) and callable(addon.stop) and "isAlive" in dir(addon) and callable(addon.isAlive) and addon.isAlive(): try: - module.stop() + addon.stop() except: pass print "Goodbye!" @@ -53,21 +53,22 @@ signal.signal(signal.SIGTERM, sigterm) logroot = os.path.join(os.environ["HOME"], "IRC") -insomnialog = open(os.path.join(logroot, "insomnia.log"), "a") InsomniaIRC = networks["InsomniaIRC"] = irc.Connection( - server="perseus.insomniairc.net", ipv6=False, ssl=True, log=insomnialog) + server="perseus.insomniairc.net", ipv6=False, ssl=True, log=open("/dev/null", "w")) ax = autoexec.Autoexec() log = logger.Logger(logroot) + +### Be sure to generate your own cert.pem and key.pem files! BNC = bouncer.Bouncer( - "", 16698, ssl=True, certfile="cert.pem", keyfile="key.pem") + "", 16698, ssl=True, certfile="cert.pem", keyfile="key.pem", autoaway="I'm off to see the wizard!") for (label, IRC) in networks.items(): - IRC.addModule(log, label=label) + IRC.addAddon(log, label=label) ### The password is 'hunter2' - IRC.addModule(BNC, label=label, passwd="6b97ed68d14eb3f1aa959ce5d49c7dc612e1eb1dafd73b1e705847483fd6a6c809f2ceb4e8df6ff9984c6298ff0285cace6614bf8daa9f0070101b6c89899e22", hashtype="sha512") + IRC.addAddon(BNC, label=label, passwd="6b97ed68d14eb3f1aa959ce5d49c7dc612e1eb1dafd73b1e705847483fd6a6c809f2ceb4e8df6ff9984c6298ff0285cace6614bf8daa9f0070101b6c89899e22", hashtype="sha512") -InsomniaIRC.addModule(ax, label="InsomniaIRC", autojoin=["#chat"]) +InsomniaIRC.addAddon(ax, label="InsomniaIRC", autojoin=["#chat"]) for (label, IRC) in networks.items(): - IRC.start() + IRC.start()
\ No newline at end of file |