Skip to content

Commit

Permalink
Merge pull request #1301 from pi-hole/ln-fallback
Browse files Browse the repository at this point in the history
Configure FTL's MACVENDORDB setting to "/macvendor.db" on startup
  • Loading branch information
PromoFaux committed Jan 23, 2023
2 parents 2c516cc + 846805a commit ad6b8a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/s6/debian-root/usr/local/bin/bash_functions.sh
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/s6/debian-root/usr/local/bin/install.sh
Expand Up @@ -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
Expand Down

0 comments on commit ad6b8a6

Please sign in to comment.