mirror of
https://github.com/gwenhael-le-moine/ledgerrb.git
synced 2024-11-15 19:48:01 +01:00
b18408e033
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
38 lines
440 B
Bash
Executable file
38 lines
440 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# CWD=$(dirname $0)
|
|
|
|
# cd $cwd
|
|
|
|
PIDFILE=./puma.pid
|
|
SERVER='bundle exec puma'
|
|
SERVER_OPTIONS=" --daemon --pidfile $PIDFILE"
|
|
|
|
function start() {
|
|
$SERVER $SERVER_OPTIONS
|
|
}
|
|
|
|
function stop() {
|
|
[ -e $PIDFILE ] && kill $(cat $PIDFILE)
|
|
}
|
|
|
|
function restart() {
|
|
stop && sleep 3 && start
|
|
}
|
|
|
|
case $1 in
|
|
"start")
|
|
start
|
|
;;
|
|
|
|
"stop")
|
|
stop
|
|
;;
|
|
|
|
"restart")
|
|
restart
|
|
;;
|
|
*)
|
|
echo "Usage; start|stop|restart"
|
|
;;
|
|
esac
|