Merge pull request #4669 from pi-hole/master

sync: master to development
This commit is contained in:
Adam Warner 2022-04-02 00:05:49 +01:00 committed by GitHub
commit fe9031b26f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 8 deletions

View file

@ -1128,8 +1128,11 @@ chooseBlocklists() {
appendToListsFile "${choice}"
done
# Create an empty adList file with appropriate permissions.
touch "${adlistFile}"
chmod 644 "${adlistFile}"
if [ ! -f "${adlistFile}" ]; then
install -m 644 /dev/null "${adlistFile}"
else
chmod 644 "${adlistFile}"
fi
}
# Accept a string parameter, it must be one of the default lists
@ -1330,8 +1333,9 @@ installConfigs() {
# and copy in the config file Pi-hole needs
install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/${LIGHTTPD_CFG} "${lighttpdConfig}"
# Make sure the external.conf file exists, as lighttpd v1.4.50 crashes without it
touch /etc/lighttpd/external.conf
chmod 644 /etc/lighttpd/external.conf
if [ ! -f /etc/lighttpd/external.conf ]; then
install -m 644 /dev/null /etc/lighttpd/external.conf
fi
# If there is a custom block page in the html/pihole directory, replace 404 handler in lighttpd config
if [[ -f "${PI_HOLE_BLOCKPAGE_DIR}/custom.php" ]]; then
sed -i 's/^\(server\.error-handler-404\s*=\s*\).*$/\1"\/pihole\/custom\.php"/' "${lighttpdConfig}"