oops, messed up a default. also fixed restart
This commit is contained in:
parent
e386b9999a
commit
55d2aa65bb
9
cloudbot
9
cloudbot
|
@ -46,13 +46,13 @@ pid = "echo 'Cannot get pid'"
|
|||
daemonstart = "daemon -r -n cloudbot -O " + pwd + \
|
||||
"/bot.log python " + pwd + "/bot.py"
|
||||
daemonstop = "daemon -n cloudbot --stop"
|
||||
daemonrestart = "daemon -n cloudbot --restart"
|
||||
daemonrestart = "./cloudbot stop > /dev/null 2>&1 && ./cloudbot start > /dev/null 2>&1"
|
||||
daemonpid = "pidof /usr/bin/daemon"
|
||||
|
||||
screenstart = "screen -d -m -S cloudbot -t cloudbot python " + pwd +\
|
||||
"/bot.py >> " + pwd + "/bot.log 2>&1"
|
||||
"/bot.py > " + pwd + "/bot.log 2>&1"
|
||||
screenstop = "kill `pidof /usr/bin/screen`"
|
||||
screenrestart = stop + " && " + start
|
||||
screenrestart = "./cloudbot stop > /dev/null 2>&1 && ./cloudbot start > /dev/null 2>&1"
|
||||
screenpid = "pidof /usr/bin/screen"
|
||||
|
||||
# Checks
|
||||
|
@ -93,6 +93,7 @@ if (backend == "daemon"):
|
|||
pid = daemonpid
|
||||
else:
|
||||
print error5
|
||||
exit
|
||||
elif (backend == "screen"):
|
||||
if screen:
|
||||
start = screenstart
|
||||
|
@ -101,10 +102,12 @@ elif (backend == "screen"):
|
|||
pid = screenpid
|
||||
else:
|
||||
print error5
|
||||
exit
|
||||
elif (backend == False):
|
||||
print firstrun
|
||||
else:
|
||||
print error5
|
||||
exit
|
||||
|
||||
# Fancy banner
|
||||
print " ______ __ ______ __ __ "\
|
||||
|
|
|
@ -23,7 +23,7 @@ if not os.path.exists('config'):
|
|||
"invitejoin": true,
|
||||
"autorejoin": false,
|
||||
"command_prefix": ".",
|
||||
"stayalive": true,
|
||||
"stayalive": false,
|
||||
"stayalive_delay": 20
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
#!/usr/bin/env python
|
||||
# Tiny little restarter by neersighted
|
||||
import sys
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
if os.path.isfile("./cloudbot"):
|
||||
restart = "./cloudbot restart"
|
||||
else:
|
||||
restart = "./bot.py"
|
||||
restart = "./cloudbot restart"
|
||||
|
||||
subprocess.call(restart, shell=True)
|
||||
sys.exit()
|
||||
|
|
Reference in New Issue