aboutsummaryrefslogtreecommitdiffstats
path: root/testing/dnscrypt-proxy/dnscrypt-proxy.initd
diff options
context:
space:
mode:
Diffstat (limited to 'testing/dnscrypt-proxy/dnscrypt-proxy.initd')
-rw-r--r--testing/dnscrypt-proxy/dnscrypt-proxy.initd25
1 files changed, 15 insertions, 10 deletions
diff --git a/testing/dnscrypt-proxy/dnscrypt-proxy.initd b/testing/dnscrypt-proxy/dnscrypt-proxy.initd
index ff63b6f418..b09763744c 100644
--- a/testing/dnscrypt-proxy/dnscrypt-proxy.initd
+++ b/testing/dnscrypt-proxy/dnscrypt-proxy.initd
@@ -1,19 +1,24 @@
#!/sbin/runscript
+pidfile=/var/run/dnscrypt-proxy/dnscrypt-proxy.pid
+command=/usr/sbin/dnscrypt-proxy
+command_args="--pidfile=$pidfile --daemonize
+ --logfile=${DNSCRYPT_LOGFILE:-/var/log/dnscrypt-proxy/dnscrypt-proxy.log}
+ --user=${DNSCRYPT_USER:-dnscrypt}
+ --local-address=${DNSCRYPT_LOCALIP:-127.0.0.1:53}"
+
+
depend() {
use net
before dns
- after logger
+ after logger firewall
}
-start() {
- ebegin "Starting dnscrypt-proxy"
- start-stop-daemon --start --quiet --pidfile=${PID} --exec /usr/sbin/dnscrypt-proxy -- -p ${PID} -l ${DNSCRYPT_LOGFILE} -d -u ${DNSCRYPT_GROUP} -a ${DNSCRYPT_LOCALIP}
- eend $?
+start_pre() {
+ checkpath --directory ${pidfile%/*}
+ # by default opendns is used but its possible to override
+ if [ -n "$RESOLVER" ] && [ -n "$PUBKEY" ] && [ -n "$PROVIDER" ]; then
+ command_args="$command_args -r ${RESOLVER} -k ${PUBKEY} -N ${PROVIDER}"
+ fi
}
-stop() {
- ebegin "Stopping dnscrypt-proxy"
- start-stop-daemon --stop --quiet --exec /usr/sbin/dnscrypt-proxy
- eend $?
-}