view src/sat.sh @ 319:5bb1cfc105d0

plugin xep-0045: misc improvments - added getUniqueRoomName method to create a room with no name conflict (need improvment) - if the room is new, the basic configuration is used to create it - _join is now used for bridge, and join can be used if we need the deferred - a trigger is added when a user join a room ("MUC user joined")
author Goffi <goffi@goffi.org>
date Fri, 06 May 2011 15:38:32 +0200
parents 31804aa9d3da
children f147b778511a
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.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