~dricottone/huttese-apk

ref: 8d429d4fa287f755f94cc74f2bac76882586282d huttese-apk/sr.ht/git-send-email.io/git-send-email.io.init -rwxr-xr-x 821 bytes
8d429d4f — Drew DeVault prometheus: upgrade to 2.14.0 5 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 $?
}