ledgerrb/rc.ledgerrb
Gwenhael Le Moine 66a08806f5 working
2015-01-11 09:42:24 +01:00

35 lines
405 B
Bash
Executable file

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