mirror of
https://github.com/pi-hole/pi-hole
synced 2024-11-18 06:08:21 +00:00
Update block page. Allow for setupVars setting of CUSTOMBLOCKPAGE (bool) to prevent it being overwritten
This commit is contained in:
parent
e9c4e8123c
commit
f270f7430c
@ -35,7 +35,7 @@ IPV4_ADDRESS=""
|
|||||||
IPV6_ADDRESS=""
|
IPV6_ADDRESS=""
|
||||||
QUERY_LOGGING=true
|
QUERY_LOGGING=true
|
||||||
INSTALL_WEB=true
|
INSTALL_WEB=true
|
||||||
|
CUSTOMBLOCKPAGE=false
|
||||||
|
|
||||||
# Find the rows and columns will default to 80x24 is it can not be detected
|
# Find the rows and columns will default to 80x24 is it can not be detected
|
||||||
screen_size=$(stty size 2>/dev/null || echo 24 80)
|
screen_size=$(stty size 2>/dev/null || echo 24 80)
|
||||||
@ -866,30 +866,48 @@ CreateLogFile() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
installPiholeWeb() {
|
installPiholeWeb() {
|
||||||
|
|
||||||
|
if [ -f ${setupVars} ]; then
|
||||||
|
. ${setupVars}
|
||||||
|
fi
|
||||||
# Install the web interface
|
# Install the web interface
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Installing pihole custom index page..."
|
echo -n "::: Installing index.php..."
|
||||||
if [ -d "/var/www/html/pihole" ]; then
|
if [ -d "/var/www/html/pihole" ]; then
|
||||||
if [ -f "/var/www/html/pihole/index.php" ]; then
|
if [ -f "/var/www/html/pihole/index.php" ]; then
|
||||||
echo "::: Existing index.php detected, not overwriting"
|
if [[ ${CUSTOMBLOCKPAGE} == true ]]; then
|
||||||
|
echo " Existing index.php detected, not overwriting"
|
||||||
|
else
|
||||||
|
cp ${PI_HOLE_LOCAL_REPO}/advanced/index.php /var/www/html/pihole/
|
||||||
|
echo " done!"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo -n "::: index.php missing, replacing... "
|
|
||||||
cp ${PI_HOLE_LOCAL_REPO}/advanced/index.php /var/www/html/pihole/
|
cp ${PI_HOLE_LOCAL_REPO}/advanced/index.php /var/www/html/pihole/
|
||||||
echo " done!"
|
echo " done!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo -n "::: Installing index.js..."
|
||||||
if [ -f "/var/www/html/pihole/index.js" ]; then
|
if [ -f "/var/www/html/pihole/index.js" ]; then
|
||||||
echo "::: Existing index.js detected, not overwriting"
|
if [[ ${CUSTOMBLOCKPAGE} == true ]]; then
|
||||||
|
echo " Existing index.js detected, not overwriting"
|
||||||
|
else
|
||||||
|
cp ${PI_HOLE_LOCAL_REPO}/advanced/index.js /var/www/html/pihole/
|
||||||
|
echo " done!"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo -n "::: index.js missing, replacing... "
|
|
||||||
cp ${PI_HOLE_LOCAL_REPO}/advanced/index.js /var/www/html/pihole/
|
cp ${PI_HOLE_LOCAL_REPO}/advanced/index.js /var/www/html/pihole/
|
||||||
echo " done!"
|
echo " done!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo -n "::: Installing blockingpage.css..."
|
||||||
if [ -f "/var/www/html/pihole/blockingpage.css" ]; then
|
if [ -f "/var/www/html/pihole/blockingpage.css" ]; then
|
||||||
echo "::: Existing blockingpage.css detected, not overwriting"
|
if [[ ${CUSTOMBLOCKPAGE} == true ]]; then
|
||||||
|
echo " Existing blockingpage.css detected, not overwriting"
|
||||||
|
else
|
||||||
|
cp ${PI_HOLE_LOCAL_REPO}/advanced/blockingpage.css /var/www/html/pihole
|
||||||
|
echo " done!"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo -n "::: blockingpage.css missing, replacing... "
|
|
||||||
cp ${PI_HOLE_LOCAL_REPO}/advanced/blockingpage.css /var/www/html/pihole
|
cp ${PI_HOLE_LOCAL_REPO}/advanced/blockingpage.css /var/www/html/pihole
|
||||||
echo " done!"
|
echo " done!"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user