0b390aaabe
- To prevent hanging on 10.x systems which ship with unbound and depend on DNS resolving, start dnscrypt-proxy before unbound. - Bump PORTREVISION PR: 194975 Differential Revision: https://reviews.freebsd.org/D1249 Submitted by: Joseph Mingrone <jrm@ftfl.ca> Approved by: koobs (mentor)
46 lines
1.6 KiB
Bash
46 lines
1.6 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: dnscrypt_proxy
|
|
# REQUIRE: SERVERS cleanvar
|
|
# 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 "opendns" 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=opendns} # 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"
|