download macvendor.db on container start if it is missing from /etc/pihole (can happen in the case of a volume mount)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2022-07-10 16:54:22 +01:00
parent 64c31b8374
commit e13586aa1e
No known key found for this signature in database
GPG Key ID: 872950F3ECF2B173
1 changed files with 6 additions and 0 deletions

View File

@ -69,6 +69,12 @@ prepare_configs() {
if [[ -e "${setupVars}" ]]; then
cp -f "${setupVars}" "${setupVars}.update.bak"
fi
#If the user has volume mounted /etc/pihole, then macvendor.db may be missing. See: https://github.com/pi-hole/docker-pi-hole/issues/1137
if [[ ! -f "/etc/pihole/macvendor.db" ]]; then
echo "Downloading missing macvendor.db"
curl -sSL "https://ftl.pi-hole.net/macvendor.db" -o "/etc/pihole/macvendor.db" || true
fi
}
validate_env() {