switched restarter to python

This commit is contained in:
neersighted 2012-02-28 20:54:42 -08:00
parent efecefbf19
commit c014d91ec2
3 changed files with 16 additions and 14 deletions

13
lib/restart.py Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env python
# Tiny little restarter by neersighted
import subprocess, sys, os
if os.path.isfile("./control.sh"):
restart = "./control.sh restart"
elif os.path.isfile("./bot.sh"):
restart = "./bot.sh restart"
else:
restart = "./bot.py"
subprocess.call(restart, shell=True)
sys.exit()

View File

@ -1,10 +0,0 @@
#!/bin/sh
sleep 5
if [ -f ./control.sh ]; then
./control.sh restart
elif [ -f ./bot.sh ]; then
./bot.sh restart
else
./bot.py
fi
exit 0

View File

@ -1,10 +1,9 @@
# Shitty plugin made by iloveportalz0r
# Broken by The Noodle
# Improved by Lukeroge
# Further improved by neersighted
from util import hook
import sys
import subprocess
import time
import sys, subprocess, time
@hook.command(autohelp=False)
def quit(inp, input=None, db=None, notice=None):
@ -30,7 +29,7 @@ def restart(inp, input=None, db=None, notice=None):
else:
input.conn.send("QUIT :Bot restarted by "+input.nick+" (no reason)")
time.sleep(3)
subprocess.call(['lib/restart.sh'])
subprocess.call(['lib/restart.py'])
sys.exit()
@hook.command