Merge pull request #1301 from pi-hole/ln-fallback

Configure FTL's MACVENDORDB setting to "/macvendor.db" on startup
This commit is contained in:
Adam Warner 2023-01-23 18:00:33 +00:00 committed by GitHub
commit ad6b8a6f0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -107,11 +107,11 @@ ensure_basic_configuration() {
cp -f "${setupVars}" "${setupVars}.update.bak"
fi
# Remove any existing macvendor.db and replace it with a symblink to the one moved to the root directory (see install.sh)
if [[ -f "/etc/pihole/macvendor.db" ]]; then
rm /etc/pihole/macvendor.db
# If FTLCONF_MACVENDORDB is not set
if [[ -z "${FTLCONF_MACVENDORDB:-}" ]]; then
# User is not passing in a custom location - so force FTL to use the file we moved to / during the build
changeFTLsetting "MACVENDORDB" "/macvendor.db"
fi
ln -s /macvendor.db /etc/pihole/macvendor.db
# When fresh empty directory volumes are used then we need to create this file
if [ ! -f /etc/dnsmasq.d/01-pihole.conf ] ; then

View File

@ -86,11 +86,11 @@ sed -i $'s/)\s*uninstallFunc/) unsupportedFunc/g' /usr/local/bin/pihole
# pihole -r / pihole reconfigure
sed -i $'s/)\s*reconfigurePiholeFunc/) unsupportedFunc/g' /usr/local/bin/pihole
# Move macvendor.db to root dir and symlink it back into /etc/pihole. See https://github.com/pi-hole/docker-pi-hole/issues/1137
# Move macvendor.db to root dir See https://github.com/pi-hole/docker-pi-hole/issues/1137
# During startup we will change FTL's configuration to point to this file instead of /etc/pihole/macvendor.db
# If user goes on to bind monunt this directory to their host, then we can easily ensure macvendor.db is the latest
# (it is otherwise only updated when FTL is updated, which doesn't happen as part of the normal course of running this image)
mv /etc/pihole/macvendor.db /macvendor.db
ln -s /macvendor.db /etc/pihole/macvendor.db
if [ ! -f /.piholeFirstBoot ]; then
touch /.piholeFirstBoot