blob: c2577fb83a634f0048244298505d35a4d409a4c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/bin/bash
set -e
log() {
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $*"
}
# Setup chroot environment
log "Setting up chroot environment..."
if /usr/libexec/unbound-helper chroot_setup; then
log "Chroot setup completed successfully"
else
log "ERROR: Chroot setup failed"
exit 1
fi
# Update root trust anchor
# This is kind of weird...
# https://manpages.debian.org/testing/unbound-anchor/unbound-anchor.8.en.html#EXIT_CODE
log "Updating root trust anchor..."
if unbound-anchor -a /var/lib/unbound/root.key; then
log "no update was necessary"
else
log "The root anchor was updated using the certificate or if the builtin root-anchor was used."
fi
# Start unbound in debug mode
log "Starting unbound daemon..."
exec /usr/sbin/unbound -d -p $DOPTS
|