freebsd-ports/dns/dnscrypt-proxy/files/dnscrypt-proxy.in
Pawel Pekala 3772632854 DNSCrypt is a piece of lightweight software that everyone
should use to boost online privacy and security. It works
by encrypting all DNS traffic between the user and OpenDNS,
preventing any spying, spoofing or man-in-the-middle attacks.

WWW:	https://www.opendns.com/technology/dnscrypt/

PR:		ports/167833
Submitted by:	Leo Vandewoestijne <freebsd@dns-lab.com>
2012-05-15 20:14:53 +00:00

36 lines
757 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: dnscrypt-proxy
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable dnscrypt-proxy:
#
# dnscrypt_proxy_enable="YES": Set to NO by default.
# Set it to YES to enable dnscrypt-proxy.
. /etc/rc.subr
name=dnscrypt_proxy
rcvar=dnscrypt_proxy_enable
stop_cmd="dnscrypt_proxy_stop"
load_rc_config dnscrypt_proxy
: {dnscrypt_proxy_enable:="NO"}
command=%%PREFIX%%/sbin/dnscrypt-proxy
procname=%%PREFIX%%/sbin/dnscrypt-proxy
pidfile=/var/run/dnscrypt-proxy.pid
logdir=/var/log/dnscrypt-proxy.log
command_args="-d -p ${pidfile} -l ${logdir}"
dnscrypt_proxy_stop() {
kill -KILL `cat ${pidfile}` 2> /dev/null && echo "Killed ${name}."
}
run_rc_command "$1"