5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 13:31:42 +00:00
panel/entrypoint.sh

39 lines
665 B
Bash
Raw Permalink Normal View History

2019-04-08 18:31:29 +00:00
#!/bin/sh
set -e
2022-03-07 15:49:49 +00:00
s_pid=/srv/tmp/puma.pid
p_pid=/tmp/prometheus.pid
2019-04-08 18:31:29 +00:00
case $1 in
2022-03-07 15:49:49 +00:00
start)
su rails -c "cd /srv && foreman run migrate"
daemonize -c /srv -u rails /usr/bin/foreman start sutty
;;
stop)
cat $s_pid | xargs -r kill
;;
reload)
cat $s_pid | xargs -r kill -USR2
;;
prometheus)
case $2 in
start)
rm -f $p_pid
daemonize -c /srv -p $p_pid -l $p_pid -u rails /usr/bin/foreman start prometheus
;;
stop)
cat $p_pid | xargs -r kill
rm -f $p_pid
;;
esac
;;
blazer)
test -z "$2" || b="_$2"
su rails -c "cd /srv && foreman run blazer$b"
2020-09-27 17:04:11 +00:00
;;
2019-04-08 18:31:29 +00:00
esac