From b246dba7e75a484120739a0eb239a150bdb50bbf Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 4 Dec 2016 21:30:59 +0100 Subject: [PATCH] Rename index.html to index.php --- advanced/{index.html => index.php} | 0 advanced/lighttpd.conf.debian | 2 +- advanced/lighttpd.conf.fedora | 2 +- automated install/basic-install.sh | 16 ++++++++++------ 4 files changed, 12 insertions(+), 8 deletions(-) rename advanced/{index.html => index.php} (100%) diff --git a/advanced/index.html b/advanced/index.php similarity index 100% rename from advanced/index.html rename to advanced/index.php diff --git a/advanced/lighttpd.conf.debian b/advanced/lighttpd.conf.debian index 15821bc7..01f52a85 100644 --- a/advanced/lighttpd.conf.debian +++ b/advanced/lighttpd.conf.debian @@ -21,7 +21,7 @@ server.modules = ( ) server.document-root = "/var/www/html" -server.error-handler-404 = "pihole/index.html" +server.error-handler-404 = "pihole/index.php" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" diff --git a/advanced/lighttpd.conf.fedora b/advanced/lighttpd.conf.fedora index 96e1311e..d2af5bd4 100644 --- a/advanced/lighttpd.conf.fedora +++ b/advanced/lighttpd.conf.fedora @@ -22,7 +22,7 @@ server.modules = ( ) server.document-root = "/var/www/html" -server.error-handler-404 = "pihole/index.html" +server.error-handler-404 = "pihole/index.php" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 33444873..8c7a6b1d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -21,6 +21,7 @@ set -e tmpLog=/tmp/pihole-install.log instalLogLoc=/etc/pihole/install.log setupVars=/etc/pihole/setupVars.conf +lighttpdConfig=/etc/lighttpd/lighttpd.conf webInterfaceGitUrl="https://github.com/pi-hole/AdminLTE.git" webInterfaceDir="/var/www/html/admin" @@ -709,9 +710,9 @@ installConfigs() { mkdir /etc/lighttpd chown "${USER}":root /etc/lighttpd elif [ -f "/etc/lighttpd/lighttpd.conf" ]; then - mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig + mv ${lighttpdConfig} ${lighttpdConfig}.orig fi - cp /etc/.pihole/advanced/${LIGHTTPD_CFG} /etc/lighttpd/lighttpd.conf + cp /etc/.pihole/advanced/${LIGHTTPD_CFG} ${lighttpdConfig} mkdir -p /var/run/lighttpd chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/run/lighttpd mkdir -p /var/cache/lighttpd/compress @@ -825,11 +826,11 @@ installPiholeWeb() { echo ":::" echo "::: Installing pihole custom index page..." if [ -d "/var/www/html/pihole" ]; then - if [ -f "/var/www/html/pihole/index.html" ]; then - echo "::: Existing index.html detected, not overwriting" + if [ -f "/var/www/html/pihole/index.php" ]; then + echo "::: Existing index.php detected, not overwriting" else - echo -n "::: index.html missing, replacing... " - cp /etc/.pihole/advanced/index.html /var/www/html/pihole/ + echo -n "::: index.php missing, replacing... " + cp /etc/.pihole/advanced/index.php /var/www/html/pihole/ echo " done!" fi @@ -955,6 +956,9 @@ accountForRefactor() { sed -i 's/piholeDNS1/PIHOLE_DNS_1/g' ${setupVars} sed -i 's/piholeDNS2/PIHOLE_DNS_2/g' ${setupVars} + # Account for change in lighttpd config file + sed -i 's:pihole/index.html:pihole/index.php:' ${lighttpdConfig} + } updatePihole() {