change working dir before check (#6197)

This commit is contained in:
kulikov-a 2022-12-17 20:14:19 +03:00 committed by GitHub
parent 403573a07b
commit bee24edaea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,6 +35,7 @@ for FILE in $(find /var/unbound/etc -depth 1); do
done
# if the root.key file is missing or damaged, run unbound-anchor
cd /var/unbound/
if ! /usr/local/sbin/unbound-checkconf /var/unbound/unbound.conf 2> /dev/null; then
# unbound-anchor has undefined behaviour if file is corrupted, start clean
rm -f /var/unbound/root.key