moved from screen to tmux
[tvweb.git] / start.sh
blob36def7c0a2bcbaf51f23eea7035fa116ce0191ad
1 #!/bin/bash
3 PID="cherryd.pid"
4 LOG="0"
5 CONFIG="etc/cherryd-tvweb.conf"
6 IMPORT="tv_web"
7 export PYTHONPATH=`pwd`
9 function printhelp {
10 cat << EOF
11 Usage: `basename $0` [-i|-log|--help]
12 -i import some other module
13 -log log into cherryd.log and put itself to background
14 --help this help screen
15 EOF
18 case "$1" in
19 -i)
20 IMPORT=$2
21 shift 2
23 -log)
24 LOG="1"
25 shift
27 --help)
28 printhelp
29 exit 1
32 echo "unknown option"
34 esac
36 [ -f $PID ] && kill `cat $PID`
37 echo "cherrypy/cherryd --config=$CONFIG --import=$IMPORT --pidfile=$PID -f"
38 echo "Logging: $LOG"
39 if [ $LOG == "1" ]; then
40 cherrypy/cherryd --config=$CONFIG --import=$IMPORT --pidfile=$PID -f >cherryd.log 2>&1 &
41 else
42 cherrypy/cherryd --config=$CONFIG --import=$IMPORT --pidfile=$PID -f