SQUASH
This commit is contained in:
parent
f1e5c68f66
commit
0e81ac5ae9
1 changed files with 6 additions and 6 deletions
10
cloudbot
10
cloudbot
|
@ -9,10 +9,12 @@ import json
|
||||||
if os.path.isfile("./config"):
|
if os.path.isfile("./config"):
|
||||||
try:
|
try:
|
||||||
config = json.load(open('config'))
|
config = json.load(open('config'))
|
||||||
|
command = ":"
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
print 'error: malformed config', e
|
print 'error: malformed config', e
|
||||||
else:
|
else:
|
||||||
config = False
|
config = False
|
||||||
|
command = "python bot.py"
|
||||||
|
|
||||||
nocol = "\033[1;m"
|
nocol = "\033[1;m"
|
||||||
red = "\033[1;31m"
|
red = "\033[1;31m"
|
||||||
|
@ -24,7 +26,6 @@ quit = "Goodbye! Thanks for using CloudBot!"
|
||||||
pwd = os.getcwd()
|
pwd = os.getcwd()
|
||||||
clearlog1 = ": > ./bot.log && "
|
clearlog1 = ": > ./bot.log && "
|
||||||
clearlog2 = ": > ./bot.log"
|
clearlog2 = ": > ./bot.log"
|
||||||
command = ":"
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
daemoncheck = subprocess.check_output("locate /usr/bin/daemon", shell=True)
|
daemoncheck = subprocess.check_output("locate /usr/bin/daemon", shell=True)
|
||||||
|
@ -40,10 +41,7 @@ except (subprocess.CalledProcessError), e:
|
||||||
print "screen not installed!"
|
print "screen not installed!"
|
||||||
exit
|
exit
|
||||||
screen = re.match(r'^/usr/bin/screen$', screencheck)
|
screen = re.match(r'^/usr/bin/screen$', screencheck)
|
||||||
if os.path.isfile("./config"):
|
backend = config.get("wrapper", {}).get("backend", "daemon")
|
||||||
backend = config.get("wrapper", {}).get("backend", "daemon")
|
|
||||||
else:
|
|
||||||
backend = daemon
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
runningcheck = subprocess.check_output("ps ax|grep cloudbot|"\
|
runningcheck = subprocess.check_output("ps ax|grep cloudbot|"\
|
||||||
|
@ -130,6 +128,7 @@ try:
|
||||||
elif (sys.argv[1] == 'clear'):
|
elif (sys.argv[1] == 'clear'):
|
||||||
command = clearlog2
|
command = clearlog2
|
||||||
else:
|
else:
|
||||||
|
command = command
|
||||||
print usage
|
print usage
|
||||||
exit
|
exit
|
||||||
else:
|
else:
|
||||||
|
@ -164,6 +163,7 @@ try:
|
||||||
elif (sys.argv[1] == 'clear'):
|
elif (sys.argv[1] == 'clear'):
|
||||||
command = clearlog2
|
command = clearlog2
|
||||||
else:
|
else:
|
||||||
|
command = command
|
||||||
print usage
|
print usage
|
||||||
exit
|
exit
|
||||||
else:
|
else:
|
||||||
|
|
Reference in a new issue