From 64866e9411fffa85e9aaea3ac510282803413023 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 18 Dec 2014 14:48:57 +0100 Subject: [PATCH] unbound: Import unbound-startup used in systemd service unit $ ls -l --full-time /usr/sbin/unbound-startup -rwxr-xr-x 1 root root 620 2014-12-18 14:48:57.000000000 +0100 /usr/sbin/unbound-startup --- misc_systemd_units/unbound-startup | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 misc_systemd_units/unbound-startup diff --git a/misc_systemd_units/unbound-startup b/misc_systemd_units/unbound-startup new file mode 100755 index 0000000..c592f46 --- /dev/null +++ b/misc_systemd_units/unbound-startup @@ -0,0 +1,38 @@ +#! /bin/sh + +# +# unbound is usuually started via systemd. +# only setup-var option is used by unbound.service + + +function setup_var() { + test -d /var/unbound || { mkdir -p /var/unbound;chown unbound /var/unbound; } + test -e /var/unbound/root.key -a /var/unbound/root.key -nt /etc/unbound/root.key || { + cp /etc/unbound/root.key /var/unbound/root.key + chown unbound /var/unbound/root.key + } +} + + + +case $* in + start) + setup_var + unbound-control start + ;; + stop) + unbound-control stop + ;; + debug) + setup_var + unbound -dd -v + ;; + setup-var) + setup_var + ;; + + *) + echo "usage: $0 [start | stop]" + exit 1 + ;; +esac