containers-geminabox/geminabox.sh

25 lines
425 B
Bash
Raw Normal View History

2019-09-18 01:01:34 +00:00
#!/bin/sh
set -e
2019-09-18 13:19:36 +00:00
dir=/srv/gems
2019-09-18 01:01:34 +00:00
pid=/tmp/geminabox.pid
cd ${dir}
for link in Gemfile Gemfile.lock .bundle config.ru; do
test -e ${link} || ln -s ../${link} .
2019-09-18 01:01:34 +00:00
done
chown -R ruby:www-data ${dir}
case $1 in
start)
rm -f ${pid}
2022-03-15 23:50:40 +00:00
daemonize -p ${pid} -l ${pid} -c ${dir} -u ruby /usr/bin/bundle exec rackup -o :: -p 9292
;;
2022-03-15 21:26:03 +00:00
stop)
test ! -f ${pid} || cat ${pid} | xargs -r kill
rm -f ${pid}
;;
esac