fixed restart, scrapped python wrapper
This commit is contained in:
parent
f0eeb9aa75
commit
600b270928
2 changed files with 8 additions and 4 deletions
|
@ -74,8 +74,12 @@ screen = re.match(r'^/usr/bin/screen$', screencheck)
|
||||||
|
|
||||||
if configfile:
|
if configfile:
|
||||||
backend = config.get("wrapper", {}).get("backend", "daemon")
|
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:
|
else:
|
||||||
backend = False
|
backend = False
|
||||||
|
daemonloc = "/usr/bin/daemon"
|
||||||
|
screenloc = "/usr/bin/screen"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
runningcheck = subprocess.check_output("ps ax|grep cloudbot|"\
|
runningcheck = subprocess.check_output("ps ax|grep cloudbot|"\
|
|
@ -3,6 +3,7 @@
|
||||||
# Improved by Lukeroge
|
# Improved by Lukeroge
|
||||||
# Further improved by neersighted
|
# Further improved by neersighted
|
||||||
from util import hook
|
from util import hook
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
@ -19,7 +20,7 @@ def stop(inp, input=None, db=None, notice=None):
|
||||||
else:
|
else:
|
||||||
input.conn.send("QUIT :Killed by " + input.nick + " (no reason)")
|
input.conn.send("QUIT :Killed by " + input.nick + " (no reason)")
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
subprocess.call("python cloudbot stop", shell=True)
|
subprocess.call("./cloudbot stop", shell=True)
|
||||||
|
|
||||||
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
|
@ -33,8 +34,7 @@ def restart(inp, input=None, db=None, notice=None):
|
||||||
else:
|
else:
|
||||||
input.conn.send("QUIT :Restarted by " + input.nick + " (no reason)")
|
input.conn.send("QUIT :Restarted by " + input.nick + " (no reason)")
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
subprocess.call("python cloudbot restart", shell=True)
|
os.execl("./cloudbot", "restart")
|
||||||
|
|
||||||
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def clear(inp, input=None, db=None, notice=None):
|
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!")
|
notice("Only bot admins can use this command!")
|
||||||
return
|
return
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
subprocess.call("python ./cloudbot clear", shell=True)
|
subprocess.call("./cloudbot clear", shell=True)
|
||||||
|
|
||||||
|
|
||||||
@hook.command
|
@hook.command
|
||||||
|
|
Reference in a new issue