view src/sat.sh @ 283:68cd30d982a5

core: added plugins for PubSub et PEP (first drafts) - plugin for XEP 0060, 0163 and 0107, based on Wokkel's pubsub - XEP 0115 plugin has been fixed, so generateHash can be called when features have changed (can be usefull to filter PEP)
author Goffi <goffi@goffi.org>
date Thu, 03 Feb 2011 18:06:25 +0100
parents 0ed5553b5313
children 31804aa9d3da
line wrap: on
line source

#!/bin/sh

#if there is one argument which is "stop", then we kill SàT
DEBUG=""
if [ $# -eq 1 ];then
	if [ $1 = "stop" ];then
		echo "Terminating Salut à Toi"
		pkill -f "twistd.*sat/sat.tac"
		exit 0
	fi
	if [ $1 = "debug" ];then
		echo "Launching SàT in debug mode"
		DEBUG="--debug"
	fi
fi

NAME='sat'

PID_FILE="/tmp/$NAME.pid"
LOG_FILE=~/".$NAME/$NAME.log"
DAEMON="n"
MAIN_OPTIONS="-${DAEMON}oy"
TAP_PATH="./"
TAP_FILE="$NAME.tac"

#Don't change the next line
AUTO_OPTIONS=""
ADDITIONAL_OPTIONS="--pidfile $PID_FILE --logfile $LOG_FILE $AUTO_OPTIONS $DEBUG"

log_dir=`dirname "$LOG_FILE"`
if [ ! -d $log_dir ] ; then
	mkdir $log_dir
fi

twistd $MAIN_OPTIONS $TAP_PATH$TAP_FILE $ADDITIONAL_OPTIONS