1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

source setupVars and only check admin repo if it is enabled

This commit is contained in:
Promofaux 2017-02-05 19:07:04 +00:00
parent e57425df5f
commit 1428b58dde

View File

@ -19,6 +19,8 @@ readonly ADMIN_INTERFACE_DIR="/var/www/html/admin"
readonly PI_HOLE_GIT_URL="https://github.com/pi-hole/pi-hole.git" readonly PI_HOLE_GIT_URL="https://github.com/pi-hole/pi-hole.git"
readonly PI_HOLE_FILES_DIR="/etc/.pihole" readonly PI_HOLE_FILES_DIR="/etc/.pihole"
source /etc/pihole/setupVars.conf
is_repo() { is_repo() {
# Use git to check if directory is currently under VCS, return the value # Use git to check if directory is currently under VCS, return the value
local directory="${1}" local directory="${1}"
@ -137,8 +139,8 @@ main() {
local web_version_current local web_version_current
#This is unlikely #This is unlikely
if ! is_repo "${PI_HOLE_FILES_DIR}" || ! is_repo "${ADMIN_INTERFACE_DIR}" ; then if ! is_repo "${PI_HOLE_FILES_DIR}" ; then
echo "::: Critical Error: One or more Pi-Hole repos are missing from system!" echo "::: Critical Error: Core Pi-Hole repo is missing from system!"
echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole" echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole"
exit 1; exit 1;
fi fi
@ -153,12 +155,20 @@ main() {
echo "::: Pi-hole Core: up to date" echo "::: Pi-hole Core: up to date"
fi fi
if GitCheckUpdateAvail "${ADMIN_INTERFACE_DIR}" ; then if [[ ${INSTALL_WEB} == true ]]; then
web_update=true if ! is_repo "${ADMIN_INTERFACE_DIR}" ; then
echo "::: Web Interface: update available" echo "::: Critical Error: Web Admin repo is missing from system!"
else echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole"
web_update=false exit 1;
echo "::: Web Interface: up to date" fi
if GitCheckUpdateAvail "${ADMIN_INTERFACE_DIR}" ; then
web_update=true
echo "::: Web Interface: update available"
else
web_update=false
echo "::: Web Interface: up to date"
fi
fi fi
# Logic # Logic