diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 76463348..1786813d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1082,6 +1082,10 @@ installConfigs() { fi # and copy in the config file Pi-hole needs cp ${PI_HOLE_LOCAL_REPO}/advanced/${LIGHTTPD_CFG} /etc/lighttpd/lighttpd.conf + # if there is a custom block page in the html/pihole directory, replace 404 handler in lighttpd config + if [[ -f "/var/www/html/pihole/custom.php" ]]; then + sed -i 's/^\(server\.error-handler-404\s*=\s*\).*$/\1"pihole\/custom\.php"/' /etc/lighttpd/lighttpd.conf + fi # Make the directories if they do not exist and set the owners mkdir -p /var/run/lighttpd chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/run/lighttpd