aboutsummaryrefslogtreecommitdiff
path: root/src/unbound-adblock/bin/entrypoint.sh
blob: b9dd19dbc333b1caabb04b4e925e2fa45f33f08b (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
#!/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
log "Updating root trust anchor..."
if unbound-anchor -a /var/lib/unbound/root.key; then
    log "Root trust anchor updated successfully"
else
    log "ERROR: Root trust anchor update failed"
    exit 1
fi

# Start unbound in debug mode
log "Starting unbound daemon..."
exec /usr/sbin/unbound -d -p $DOPTS