Skip to content

Commit

Permalink
Merge pull request #177 from mariux64/import-unbound-startup
Browse files Browse the repository at this point in the history
Import and install `unbound-startup`
  • Loading branch information
pmenzel authored May 3, 2021
2 parents 1550282 + 28caee4 commit 96ca41c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ install_data misc_systemd_units/enable_overcommit_memory.service "$DESTDIR$syste
install_data misc_systemd_units/gdm.service "$DESTDIR$systemdunitdir/gdm.service"
install_data misc_systemd_units/startup-tags.service "$DESTDIR$systemdunitdir/startup-tags.service"
install_data misc_systemd_units/unbound.service "$DESTDIR$systemdunitdir/unbound.service"
install_exec misc_systemd_units/unbound-startup "$DESTDIR$usr_sbindir/unbound-startup"
install_data misc_systemd_units/xaruba.service "$DESTDIR$systemdunitdir/xaruba.service"
install_data misc_systemd_units/yppasswd.service "$DESTDIR$systemdunitdir/yppasswd.service"
install_data misc_systemd_units/ypserv.service "$DESTDIR$systemdunitdir/ypserv.service"
Expand Down
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 96ca41c

Please sign in to comment.