ports/dns/dnscrypt-proxy/files/dnscrypt-proxy.in
Jason Unovitch c593ed38c7 dns/dnscrypt-proxy: ensure daemon starts after ldconfig
- While here, fix format of $FreeBSD$ tag in rc script
- Also remove fbsd:nokeywords and add svn:keywords to rc script

PR:		203059
Submitted by:	Gregorio Guidi <gregorio.guidi@gmail.com> (original patch)
Approved by:	Leo Vandewoestijne <freebsd@dns-lab.com> (maintainer)
2015-09-26 02:39:09 +00:00

46 lines
1.7 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: dnscrypt_proxy
# REQUIRE: SERVERS cleanvar ldconfig
# BEFORE: named local_unbound unbound
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable dnscrypt-proxy:
#
# dnscrypt_proxy_enable (bool): Set to NO by default.
# Set to YES to enable dnscrypt-proxy.
# dnscrypt_proxy_uid (str): Set to "_dnscrypt-proxy" by default.
# User to switch to after starting.
# dnscrypt_proxy_resolver (str):Set to "cisco" by default.
# Choose a different upstream resolver.
# dnscrypt_proxy_pidfile (str): default: "/var/run/dnscrypt-proxy.pid"
# Location of pid file.
# dnscrypt_proxy_logfile (str): default: "/var/log/dnscrypt-proxy.log"
# Location of log file.
#
# To redirect a local resolver through dnscrypt-proxy, point it at 127.0.0.2
# and add the following to rc.conf:
# ifconfig_lo0_alias0="inet 127.0.0.2 netmask 0xffffffff"
# dnscrypt_proxy_flags='-a 127.0.0.2'
. /etc/rc.subr
name=dnscrypt_proxy
rcvar=dnscrypt_proxy_enable
load_rc_config ${name}
: ${dnscrypt_proxy_enable:=NO}
: ${dnscrypt_proxy_uid=_dnscrypt-proxy} # User to run daemon as
: ${dnscrypt_proxy_resolver=cisco} # resolver to use
: ${dnscrypt_proxy_pidfile=/var/run/dnscrypt-proxy.pid} # Path to pid file
: ${dnscrypt_proxy_logfile=/var/log/dnscrypt-proxy.log} # Path to log file
command=%%PREFIX%%/sbin/dnscrypt-proxy
command_args="-d -p ${dnscrypt_proxy_pidfile} -l ${dnscrypt_proxy_logfile} -u ${dnscrypt_proxy_uid} -R ${dnscrypt_proxy_resolver}"
procname=%%PREFIX%%/sbin/dnscrypt-proxy
pidfile=${dnscrypt_proxy_pidfile}
run_rc_command "$1"