aboutsummaryrefslogtreecommitdiff
path: root/src/unbound-adblock/bin/entrypoint.sh
blob: 24a18a76b076484e41392a9ec39d912c7c9aa347 (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 /usr/libexec/unbound-helper root_trust_anchor_update; 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