ledgerrb/rc.ledgerrb

39 lines
440 B
Text
Raw Normal View History

2014-07-31 18:51:55 +02:00
#!/bin/sh
# CWD=$(dirname $0)
# cd $cwd
2015-01-11 09:36:44 +01:00
2015-09-17 07:12:22 +02:00
PIDFILE=./puma.pid
2015-08-30 22:47:50 +02:00
SERVER='bundle exec puma'
2015-09-17 07:12:22 +02:00
SERVER_OPTIONS=" --daemon --pidfile $PIDFILE"
2015-01-11 09:26:37 +01:00
function start() {
$SERVER $SERVER_OPTIONS
}
function stop() {
2015-08-30 22:41:46 +02:00
[ -e $PIDFILE ] && kill $(cat $PIDFILE)
2015-01-11 09:26:37 +01:00
}
function restart() {
stop && sleep 3 && start
}
2014-07-31 18:51:55 +02:00
case $1 in
"start")
2015-01-11 09:26:37 +01:00
start
2014-07-31 18:51:55 +02:00
;;
"stop")
2015-01-11 09:26:37 +01:00
stop
2014-07-31 18:51:55 +02:00
;;
"restart")
2015-01-11 09:26:37 +01:00
restart
2014-07-31 18:51:55 +02:00
;;
*)
echo "Usage; start|stop|restart"
;;
esac