~dricottone/huttese-apk

ref: 4bbaacb863e59dee26ad09e129e623209fd7fe93 huttese-apk/sr.ht/git-send-email.io/git-send-email.io.init -rwxr-xr-x 821 bytes
4bbaacb8 — Simon Ser soju: upgrade 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/sbin/openrc-run
name="git-send-email.io"
description="git-send-email.io webhook service"

# Override these with /etc/conf.d/git-send-emaio.io
GITSENDEMAIL_USER=${GITSENDEMAIL_USER:-gitsendemail}
GITSENDEMAIL_BIND=${GITSENDEMAIL_BIND:-127.0.0.1:5001}
GITSENDEMAIL_ARGS=${GITSENDEMAIL_ARGS:-}
LOGS=/var/log/git-send-emaio.io.log

depend() {
	need net
}

start() {
	ebegin "Starting $name"
	touch "$LOGS"
	chown ${GITSENDEMAIL_USER} "$LOGS"
	start-stop-daemon \
		-u ${GITSENDEMAIL_USER} \
		-1 "$LOGS" \
		-2 "$LOGS" \
		--background \
		--make-pidfile \
		--pidfile /run/$name.pid \
		--exec /usr/bin/gunicorn -- \
			email_tutorial.app:app -b ${GITSENDEMAIL_BIND} ${GITSENDEMAIL_ARGS}
	eend $?
}

stop() {
	ebegin "Stopping $name"
	start-stop-daemon --stop --exec /usr/bin/gunicorn --pidfile /run/$name.pid
	eend $?
}