added start and stop scripts since all this depends on persistent processes

kind of hacky though - i get the id of the python process out of stderr
This commit is contained in:
Travis Parker 2009-04-28 16:06:40 -07:00
parent 35dd276d86
commit da660769d3
3 changed files with 18 additions and 0 deletions

View File

@ -58,6 +58,7 @@ class Handlers(object):
def main():
print >> sys.stderr, "%d\n" % os.getpid()
h = Handlers()
notifier_init()
while True:

12
start.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env sh
DIR=$HOME/.mcabber
pidtail() {
tail -F $1 &
echo $! 1>&2
}
echo -n > $DIR/notify_pids
(pidtail $DIR/last_event 2>> $DIR/notify_pids | python $DIR/mcabbernotify.py 2>> $DIR/notify_pids) &
echo $! >> $DIR/notify_pids

5
stop.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
DIR=$HOME/.mcabber
[ -f $DIR/notify_pids ] && cat $DIR/notify_pids | xargs kill && rm $DIR/notify_pids