mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
basic_install: Use a varibale for the pihole dashboard dir
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
parent
dc91d4b1f9
commit
d5bbb2b640
1 changed files with 6 additions and 5 deletions
|
@ -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
|
# This directory is where the Pi-hole scripts will be installed
|
||||||
PI_HOLE_INSTALL_DIR="/opt/pihole"
|
PI_HOLE_INSTALL_DIR="/opt/pihole"
|
||||||
PI_HOLE_CONFIG_DIR="/etc/pihole"
|
PI_HOLE_CONFIG_DIR="/etc/pihole"
|
||||||
|
PI_HOLE_BLOCKPAGE_DIR="/var/www/html/pihole"
|
||||||
useUpdateVars=false
|
useUpdateVars=false
|
||||||
|
|
||||||
adlistFile="/etc/pihole/adlists.list"
|
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
|
# Make sure the external.conf file exists, as lighttpd v1.4.50 crashes without it
|
||||||
touch /etc/lighttpd/external.conf
|
touch /etc/lighttpd/external.conf
|
||||||
# if there is a custom block page in the html/pihole directory, replace 404 handler in lighttpd config
|
# 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
|
sed -i 's/^\(server\.error-handler-404\s*=\s*\).*$/\1"pihole\/custom\.php"/' /etc/lighttpd/lighttpd.conf
|
||||||
fi
|
fi
|
||||||
# Make the directories if they do not exist and set the owners
|
# 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"
|
local str="Creating directory for blocking page, and copying files"
|
||||||
printf " %b %s..." "${INFO}" "${str}"
|
printf " %b %s..." "${INFO}" "${str}"
|
||||||
# Install the directory
|
# Install the directory
|
||||||
install -d /var/www/html/pihole
|
install -d ${PI_HOLE_BLOCKPAGE_DIR}
|
||||||
# and the blockpage
|
# 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
|
# Remove superseded file
|
||||||
if [[ -e "/var/www/html/pihole/index.js" ]]; then
|
if [[ -e "${PI_HOLE_BLOCKPAGE_DIR}/index.js" ]]; then
|
||||||
rm "/var/www/html/pihole/index.js"
|
rm "${PI_HOLE_BLOCKPAGE_DIR}/index.js"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
|
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
|
||||||
|
|
Loading…
Reference in a new issue