Update update.sh, updatecheck.sh and uninstall.sh to honour pihole.toml settings for webserver.paths.webroot and webserver.paths.webhome
When uninstalling, remove web interface parent directory empty check and possible removal. Signed-off-by: James George <james.george@vigilantvoid.com>
This commit is contained in:
@@ -42,6 +42,8 @@ function get_remote_hash() {
|
||||
# shellcheck disable=SC1091
|
||||
. /opt/pihole/utils.sh
|
||||
|
||||
readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome")
|
||||
|
||||
# Remove the below three legacy files if they exist
|
||||
rm -f "/etc/pihole/GitHubVersions"
|
||||
rm -f "/etc/pihole/localbranches"
|
||||
@@ -85,13 +87,13 @@ addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_CORE_HASH" "${GITHUB_CORE_HASH}"
|
||||
|
||||
# get Web versions
|
||||
|
||||
WEB_VERSION="$(get_local_version /var/www/html/admin)"
|
||||
WEB_VERSION="$(get_local_version "${ADMIN_INTERFACE_DIR}")"
|
||||
addOrEditKeyValPair "${VERSION_FILE}" "WEB_VERSION" "${WEB_VERSION}"
|
||||
|
||||
WEB_BRANCH="$(get_local_branch /var/www/html/admin)"
|
||||
WEB_BRANCH="$(get_local_branch "${ADMIN_INTERFACE_DIR}")"
|
||||
addOrEditKeyValPair "${VERSION_FILE}" "WEB_BRANCH" "${WEB_BRANCH}"
|
||||
|
||||
WEB_HASH="$(get_local_hash /var/www/html/admin)"
|
||||
WEB_HASH="$(get_local_hash "${ADMIN_INTERFACE_DIR}")"
|
||||
addOrEditKeyValPair "${VERSION_FILE}" "WEB_HASH" "${WEB_HASH}"
|
||||
|
||||
GITHUB_WEB_VERSION="$(get_remote_version web "${WEB_BRANCH}")"
|
||||
|
||||
Reference in New Issue
Block a user