adjust lighttpd config depending on whether or not custom.php exists

Signed-off-by: Adam Warner <adamw@rner.email>
pull/1688/head
Adam Warner 7 years ago
parent 6c605f55f9
commit 5f4be0de35
No known key found for this signature in database
GPG Key ID: 03843F6C65554B22

@ -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

Loading…
Cancel
Save