Skip to content

Commit

Permalink
unbound: Import unbound-startup used in systemd service unit
Browse files Browse the repository at this point in the history
    $ 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
  • Loading branch information
donald authored and pmenzel committed May 3, 2021
1 parent 1550282 commit 64866e9
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions misc_systemd_units/unbound-startup
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 64866e9

Please sign in to comment.