ledgerrb/rc.ledgerrb
2015-09-17 07:12:22 +02:00

36 lines
420 B
Bash
Executable file

#!/bin/sh
CWD=$(pwd)
PIDFILE=./puma.pid
SERVER='bundle exec puma'
SERVER_OPTIONS=" --daemon --pidfile $PIDFILE"
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