Make installPiholeWeb() more inteliigent. Checks for existence of /var/www/html/pihole, and only downloads from repo if it does not exist. Will stop install script from overwriting any tweaks users have made to index.html

This commit is contained in:
Promofaux 2016-01-20 22:14:17 +00:00
parent 96011bc2ae
commit 5c25c42da8

View file

@ -252,6 +252,7 @@ $SUDO apt-get -y install git
} }
installWebAdmin(){ installWebAdmin(){
$SUDO echo " "
if [ -d "/var/www/html/admin" ]; then if [ -d "/var/www/html/admin" ]; then
$SUDO rm -rf /var/www/html/admin $SUDO rm -rf /var/www/html/admin
fi fi
@ -278,9 +279,14 @@ fi
} }
installPiholeWeb(){ installPiholeWeb(){
$SUDO echo " "
if [ -d "/var/www/html/pihole" ]; then
$SUDO echo "::: Existing pihole custom page detected, not overwriting"
else
$SUDO mkdir /var/www/html/pihole $SUDO mkdir /var/www/html/pihole
$SUDO mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig $SUDO mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig
$SUDO curl -o /var/www/html/pihole/index.html https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/index.html $SUDO curl -o /var/www/html/pihole/index.html https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/index.html
fi
} }
installCron(){ installCron(){