aboutsummaryrefslogtreecommitdiffstats
path: root/community/dnscrypt-proxy/dnscrypt-proxy.initd
blob: bd6c1070a1fd3f4de07e0c2626d41d8bde4f8492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

command="/usr/bin/dnscrypt-proxy"
command_args="${DNSCRYPT_OPTS:---config /etc/dnscrypt-proxy/dnscrypt-proxy.toml}"
command_user="${DNSCRYPT_USER:-dnscrypt}:${DNSCRYPT_GROUP:-dnscrypt}"
pidfile="/run/${SVCNAME}.pid"
start_stop_daemon_args="--background --make-pidfile"

depend() {
	use net logger
	provide dns
}

start_pre() {
	checkpath -q -d -m 0775 -o "${command_user}" \
		/var/cache/"${SVCNAME}" \
		/var/log/"${SVCNAME}"
	setcap cap_net_bind_service=+ep "${command}"
}