mirror of
https://github.com/gwenhael-le-moine/ledgerrb.git
synced 2024-12-27 21:58:11 +01:00
35 lines
405 B
Bash
Executable file
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
|