diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd')
-rw-r--r-- | net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd new file mode 100644 index 000000000000..9b07d7d47d82 --- /dev/null +++ b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd @@ -0,0 +1,47 @@ +#!/sbin/openrc-run +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +DNSCRYPT_LOGFILE=${DNSCRYPT_LOGFILE:-/var/log/dnscrypt-proxy.log} + +rundir=${rundir:-/var/run/dnscrypt-proxy} +pidfile=${pidfile:-${rundir}/dnscrypt-proxy.pid} +rundir=${rundir:-/var/run/dnscrypt-proxy} +runas_user=${runas_user:-dnscrypt} +runas_group=${runas_user:-dnscrypt} + +depend() { + use net + before dns + after logger +} + +start() { + if [ ! -d "${rundir}" ]; then + mkdir "${rundir}" + if [ -n "${runas_user}" ]; then + touch "${DNSCRYPT_LOGFILE}" + chown ${runas_user}:${runas_group} "${DNSCRYPT_LOGFILE}" + chown -R ${runas_user}:${runas_group} "${rundir}" + fi + fi + + ebegin "Starting dnscrypt-proxy" + start-stop-daemon --start --quiet \ + --exec /usr/sbin/dnscrypt-proxy \ + -- \ + --pidfile="${pidfile}" \ + --logfile="${DNSCRYPT_LOGFILE}" \ + --daemonize --user=${runas_user} \ + --local-address=${DNSCRYPT_LOCALIP}:${DNSCRYPT_LOCALPORT} \ + --resolver-address=${DNSCRYPT_RESOLVERIP}:${DNSCRYPT_RESOLVERPORT} \ + --provider-name=${DNSCRYPT_PROVIDER_NAME} \ + --provider-key=${DNSCRYPT_PROVIDER_KEY} + eend $? +} + +stop() { + ebegin "Stopping dnscrypt-proxy" + start-stop-daemon --stop --quiet --exec /usr/sbin/dnscrypt-proxy + eend $? +} |