From e13586aa1ea09ca9279007c9990c7aafb4733c05 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 10 Jul 2022 16:54:22 +0100 Subject: [PATCH] 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 --- bash_functions.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bash_functions.sh b/bash_functions.sh index 1ef674c..842e834 100644 --- a/bash_functions.sh +++ b/bash_functions.sh @@ -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() {