ledgerrb/rc.ledgerrb
Gwenhael Le Moine e74249cc11 start with puma
2015-08-30 22:47:50 +02:00

37 lines
447 B
Bash
Executable file

#!/bin/sh
CWD=$(pwd)
PIDFILE=./ledgerrb.pid
PORT=9292
SERVER='bundle exec puma'
SERVER_OPTIONS=' --daemon --pidfile $PIDFILE --port $PORT'
function start() {
$SERVER $SERVER_OPTIONS
}
function stop() {
[ -e $PIDFILE ] && kill $(cat $PIDFILE)
}
function restart() {
stop && sleep 3 && start
}
case $1 in
"start")
start
;;
"stop")
stop
;;
"restart")
restart
;;
*)
echo "Usage; start|stop|restart"
;;
esac