~dricottone/huttese-apk

ref: 0aefaebac3a764012a753e3d73c159ed66f15f79 huttese-apk/sr.ht/git-send-email.io/git-send-email.io.init -rwxr-xr-x 821 bytes
0aefaeba — Drew DeVault Update build.yml in preparation for 3.15 upgrade 2 years ago
                                                                                
6ede0c8e Drew DeVault
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 $?
}