basic_install: Use a varibale for the pihole dashboard dir

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
pull/2621/head
Andreas Schneider 5 years ago
parent dc91d4b1f9
commit d5bbb2b640

@ -62,6 +62,7 @@ PI_HOLE_FILES=(chronometer list piholeDebug piholeLogFlush setupLCD update versi
# This directory is where the Pi-hole scripts will be installed
PI_HOLE_INSTALL_DIR="/opt/pihole"
PI_HOLE_CONFIG_DIR="/etc/pihole"
PI_HOLE_BLOCKPAGE_DIR="/var/www/html/pihole"
useUpdateVars=false
adlistFile="/etc/pihole/adlists.list"
@ -1387,7 +1388,7 @@ installConfigs() {
# Make sure the external.conf file exists, as lighttpd v1.4.50 crashes without it
touch /etc/lighttpd/external.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
if [[ -f "${PI_HOLE_BLOCKPAGE_DIR}/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
@ -1653,13 +1654,13 @@ installPiholeWeb() {
local str="Creating directory for blocking page, and copying files"
printf " %b %s..." "${INFO}" "${str}"
# Install the directory
install -d /var/www/html/pihole
install -d ${PI_HOLE_BLOCKPAGE_DIR}
# and the blockpage
install -D ${PI_HOLE_LOCAL_REPO}/advanced/{index,blockingpage}.* /var/www/html/pihole/
install -D ${PI_HOLE_LOCAL_REPO}/advanced/{index,blockingpage}.* ${PI_HOLE_BLOCKPAGE_DIR}/
# Remove superseded file
if [[ -e "/var/www/html/pihole/index.js" ]]; then
rm "/var/www/html/pihole/index.js"
if [[ -e "${PI_HOLE_BLOCKPAGE_DIR}/index.js" ]]; then
rm "${PI_HOLE_BLOCKPAGE_DIR}/index.js"
fi
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"

Loading…
Cancel
Save