2014-07-31 18:51:55 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-01-11 09:36:44 +01:00
|
|
|
PIDFILE=./puma.pid
|
|
|
|
|
2015-01-11 09:26:37 +01:00
|
|
|
SERVER='bundle exec puma'
|
|
|
|
SERVER_OPTIONS=' --daemon --pidfile $PIDFILE'
|
|
|
|
|
|
|
|
function start() {
|
|
|
|
$SERVER $SERVER_OPTIONS
|
|
|
|
}
|
|
|
|
|
|
|
|
function stop() {
|
2015-01-11 09:36:44 +01:00
|
|
|
[ -e $PIDFILE ] && kill $(cat $PIDFILE) && rm $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
|