mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +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
1 changed files with 26 additions and 8 deletions
|
@ -35,7 +35,7 @@ IPV4_ADDRESS=""
|
|||
IPV6_ADDRESS=""
|
||||
QUERY_LOGGING=true
|
||||
INSTALL_WEB=true
|
||||
|
||||
CUSTOMBLOCKPAGE=false
|
||||
|
||||
# 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)
|
||||
|
@ -866,30 +866,48 @@ CreateLogFile() {
|
|||
}
|
||||
|
||||
installPiholeWeb() {
|
||||
|
||||
if [ -f ${setupVars} ]; then
|
||||
. ${setupVars}
|
||||
fi
|
||||
# Install the web interface
|
||||
echo ":::"
|
||||
echo "::: Installing pihole custom index page..."
|
||||
echo -n "::: Installing index.php..."
|
||||
if [ -d "/var/www/html/pihole" ]; 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
|
||||
echo -n "::: index.php missing, replacing... "
|
||||
cp ${PI_HOLE_LOCAL_REPO}/advanced/index.php /var/www/html/pihole/
|
||||
echo " done!"
|
||||
fi
|
||||
|
||||
echo -n "::: Installing index.js..."
|
||||
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
|
||||
echo -n "::: index.js missing, replacing... "
|
||||
cp ${PI_HOLE_LOCAL_REPO}/advanced/index.js /var/www/html/pihole/
|
||||
echo " done!"
|
||||
fi
|
||||
|
||||
echo -n "::: Installing blockingpage.css..."
|
||||
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
|
||||
echo -n "::: blockingpage.css missing, replacing... "
|
||||
cp ${PI_HOLE_LOCAL_REPO}/advanced/blockingpage.css /var/www/html/pihole
|
||||
echo " done!"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue