ledgerrb/rc.ledgerrb
Gwenhael Le Moine 0bbb2f9254 more better
2015-01-11 09:39:03 +01:00

37 lines
434 B
Bash
Executable file

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