dnscrypt-proxy 1.4.0
[tomato.git] / release / src / router / dnscrypt / packages / debian / dnscrypt-proxy.upstart
blobedc63aaaaa6e24f9847f8c365045ab98469ca23b
1 description "dnscrypt-proxy startup script"
3 start on (local-filesystems and net-device-up IFACE=lo)
4 stop on runlevel [!2345]
6 pre-start script
7     # This is the home dir of user "dnscrypt"
8     # dnscrypt-proxy will chroot there for security reasons
9     mkdir -p /run/dnscrypt
11     #Load the AppArmor profile, otherwise it wouldn't be applied
12     /lib/init/apparmor-profile-load usr.sbin.dnscrypt-proxy || true
13 end script
15 script
16     conffile="/etc/default/dnscrypt-proxy"
18     if test -r "$conffile"; then
19         params="$(grep -v '^#' $conffile | cut -d '#' -f 1 | grep -v '^resolvconf')"
20         for parameter in $params; do
21             test -n "$parameter" && options="$options --$parameter"
22         done
23     fi
25     exec /usr/sbin/dnscrypt-proxy $options
26 end script