ledgerrb/rc.ledgerrb
2015-08-30 20:07:21 +02:00

35 lines
398 B
Bash
Executable file

#!/bin/sh
CWD=$(pwd)
SERVER='bundle exec rackup'
SERVER_OPTIONS=' -D -P ./ledgerrb.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