3 fdbb3c73 2025-06-03 xs install_unbound_adblock() {
4 fdbb3c73 2025-06-03 xs useradd -s /sbin/nologin -d /var/empty _adblock 2>/dev/null && {
5 fdbb3c73 2025-06-03 xs /usr/bin/install -m 644 -o _adblock -g wheel /dev/null /var/unbound/db/adblock.rpz
6 fdbb3c73 2025-06-03 xs /usr/bin/install -d -o root -g wheel -m 755 /var/log/unbound-adblock
7 fdbb3c73 2025-06-03 xs /usr/bin/install -o _adblock -g wheel -m 640 /dev/null /var/log/unbound-adblock/unbound-adblock.log
8 fdbb3c73 2025-06-03 xs /usr/bin/install -o _adblock -g wheel -m 640 /dev/null /var/log/unbound-adblock/unbound-adblock.log.0.gz
9 fdbb3c73 2025-06-03 xs test -f "/var/unbound/etc/unbound_control.key" || unbound-control-setup
10 fdbb3c73 2025-06-03 xs crontab -u _adblock - <<-..
11 fdbb3c73 2025-06-03 xs ~ 0~2 * * * -s unbound-adblock -O openbsd
14 fdbb3c73 2025-06-03 xs groupinstall -m 755 -o root:bin unbound-adblock /usr/local/bin &&
16 fdbb3c73 2025-06-03 xs doas -u _adblock unbound-adblock -O openbsd