From 55d2aa65bb5ec9594654e0153661e04d0b0de448 Mon Sep 17 00:00:00 2001 From: neersighted Date: Thu, 1 Mar 2012 12:40:55 -0800 Subject: [PATCH] oops, messed up a default. also fixed restart --- cloudbot | 9 ++++++--- core/config.py | 2 +- lib/restart.py | 6 +----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cloudbot b/cloudbot index 02858ea..22fa518 100755 --- a/cloudbot +++ b/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 " ______ __ ______ __ __ "\ diff --git a/core/config.py b/core/config.py index e7168b0..2a1de39 100755 --- a/core/config.py +++ b/core/config.py @@ -23,7 +23,7 @@ if not os.path.exists('config'): "invitejoin": true, "autorejoin": false, "command_prefix": ".", - "stayalive": true, + "stayalive": false, "stayalive_delay": 20 } }, diff --git a/lib/restart.py b/lib/restart.py index 0f2e309..9fcf3a2 100755 --- a/lib/restart.py +++ b/lib/restart.py @@ -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()