From 600b27092882de3df1443185ee72af7d24eb4926 Mon Sep 17 00:00:00 2001 From: neersighted Date: Thu, 1 Mar 2012 14:17:12 -0800 Subject: [PATCH] fixed restart, scrapped python wrapper --- cloudbot => disabled_plugins/cloudbot | 4 ++++ plugins/admin.py | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) rename cloudbot => disabled_plugins/cloudbot (96%) diff --git a/cloudbot b/disabled_plugins/cloudbot similarity index 96% rename from cloudbot rename to disabled_plugins/cloudbot index 22fa518..d2f2cda 100755 --- a/cloudbot +++ b/disabled_plugins/cloudbot @@ -74,8 +74,12 @@ screen = re.match(r'^/usr/bin/screen$', screencheck) if configfile: backend = config.get("wrapper", {}).get("backend", "daemon") + daemonloc = config.get("wrapper", {}).get("daemonloc", "/usr/bin/daemon") + screenloc = config.get("wrapper", {}).get("screenloc", "/usr/bin/screen") else: backend = False + daemonloc = "/usr/bin/daemon" + screenloc = "/usr/bin/screen" try: runningcheck = subprocess.check_output("ps ax|grep cloudbot|"\ diff --git a/plugins/admin.py b/plugins/admin.py index 903758e..7bbd351 100755 --- a/plugins/admin.py +++ b/plugins/admin.py @@ -3,6 +3,7 @@ # Improved by Lukeroge # Further improved by neersighted from util import hook +import os import sys import subprocess import time @@ -19,7 +20,7 @@ def stop(inp, input=None, db=None, notice=None): else: input.conn.send("QUIT :Killed by " + input.nick + " (no reason)") time.sleep(5) - subprocess.call("python cloudbot stop", shell=True) + subprocess.call("./cloudbot stop", shell=True) @hook.command(autohelp=False) @@ -33,8 +34,7 @@ def restart(inp, input=None, db=None, notice=None): else: input.conn.send("QUIT :Restarted by " + input.nick + " (no reason)") time.sleep(5) - subprocess.call("python cloudbot restart", shell=True) - + os.execl("./cloudbot", "restart") @hook.command(autohelp=False) def clear(inp, input=None, db=None, notice=None): @@ -43,7 +43,7 @@ def clear(inp, input=None, db=None, notice=None): notice("Only bot admins can use this command!") return time.sleep(5) - subprocess.call("python ./cloudbot clear", shell=True) + subprocess.call("./cloudbot clear", shell=True) @hook.command