mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-24 08:10:14 +00:00
Merge branch 'master' of https://github.com/pi-hole/pi-hole
This commit is contained in:
commit
ee86a81ecd
10 changed files with 130 additions and 98 deletions
|
@ -809,8 +809,14 @@ process_status(){
|
|||
local i
|
||||
# For each process,
|
||||
for i in "${PIHOLE_PROCESSES[@]}"; do
|
||||
# get its status via systemctl
|
||||
local status_of_process=$(systemctl is-active "${i}")
|
||||
# If systemd
|
||||
if command -v systemctl &> /dev/null; then
|
||||
# get its status via systemctl
|
||||
local status_of_process=$(systemctl is-active "${i}")
|
||||
else
|
||||
# Otherwise, use the service command
|
||||
local status_of_process=$(service "${i}" status | awk '/Active:/ {print $2}') &> /dev/null
|
||||
fi
|
||||
# and print it out to the user
|
||||
if [[ "${status_of_process}" == "active" ]]; then
|
||||
# If it's active, show it in green
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
|
||||
# Network-wide ad blocking via your own hardware.
|
||||
#
|
||||
# Checks for updates via GitHub
|
||||
# Checks for local or remote versions and branches
|
||||
#
|
||||
# This file is copyright under the latest version of the EUPL.
|
||||
# Please see LICENSE file for your rights under this license.
|
||||
|
@ -25,35 +25,42 @@ function json_extract() {
|
|||
fi
|
||||
}
|
||||
|
||||
GITHUB_CORE_VERSION="$(json_extract tag_name "$(curl -q 'https://api.github.com/repos/pi-hole/pi-hole/releases/latest' 2> /dev/null)")"
|
||||
GITHUB_WEB_VERSION="$(json_extract tag_name "$(curl -q 'https://api.github.com/repos/pi-hole/AdminLTE/releases/latest' 2> /dev/null)")"
|
||||
GITHUB_FTL_VERSION="$(json_extract tag_name "$(curl -q 'https://api.github.com/repos/pi-hole/FTL/releases/latest' 2> /dev/null)")"
|
||||
|
||||
echo "${GITHUB_CORE_VERSION} ${GITHUB_WEB_VERSION} ${GITHUB_FTL_VERSION}" > "/etc/pihole/GitHubVersions"
|
||||
|
||||
function get_local_branch() {
|
||||
# Return active branch
|
||||
cd "${1}" 2> /dev/null || return 1
|
||||
git rev-parse --abbrev-ref HEAD || return 1
|
||||
}
|
||||
|
||||
CORE_BRANCH="$(get_local_branch /etc/.pihole)"
|
||||
WEB_BRANCH="$(get_local_branch /var/www/html/admin)"
|
||||
#FTL_BRANCH="$(pihole-FTL branch)"
|
||||
# Don't store FTL branch until the next release of FTL which
|
||||
# supports returning the branch in an easy way
|
||||
FTL_BRANCH="XXX"
|
||||
|
||||
echo "${CORE_BRANCH} ${WEB_BRANCH} ${FTL_BRANCH}" > "/etc/pihole/localbranches"
|
||||
|
||||
function get_local_version() {
|
||||
# Return active branch
|
||||
cd "${1}" 2> /dev/null || return 1
|
||||
git describe --long --dirty --tags || return 1
|
||||
# Return active branch
|
||||
cd "${1}" 2> /dev/null || return 1
|
||||
git describe --long --dirty --tags || return 1
|
||||
}
|
||||
|
||||
CORE_VERSION="$(get_local_version /etc/.pihole)"
|
||||
WEB_VERSION="$(get_local_version /var/www/html/admin)"
|
||||
FTL_VERSION="$(pihole-FTL version)"
|
||||
if [[ "$2" == "remote" ]]; then
|
||||
|
||||
echo "${CORE_VERSION} ${WEB_VERSION} ${FTL_VERSION}" > "/etc/pihole/localversions"
|
||||
if [[ "$3" == "reboot" ]]; then
|
||||
sleep 30
|
||||
fi
|
||||
|
||||
GITHUB_CORE_VERSION="$(json_extract tag_name "$(curl -q 'https://api.github.com/repos/pi-hole/pi-hole/releases/latest' 2> /dev/null)")"
|
||||
GITHUB_WEB_VERSION="$(json_extract tag_name "$(curl -q 'https://api.github.com/repos/pi-hole/AdminLTE/releases/latest' 2> /dev/null)")"
|
||||
GITHUB_FTL_VERSION="$(json_extract tag_name "$(curl -q 'https://api.github.com/repos/pi-hole/FTL/releases/latest' 2> /dev/null)")"
|
||||
|
||||
echo "${GITHUB_CORE_VERSION} ${GITHUB_WEB_VERSION} ${GITHUB_FTL_VERSION}" > "/etc/pihole/GitHubVersions"
|
||||
|
||||
else
|
||||
|
||||
CORE_BRANCH="$(get_local_branch /etc/.pihole)"
|
||||
WEB_BRANCH="$(get_local_branch /var/www/html/admin)"
|
||||
FTL_BRANCH="$(pihole-FTL branch)"
|
||||
|
||||
echo "${CORE_BRANCH} ${WEB_BRANCH} ${FTL_BRANCH}" > "/etc/pihole/localbranches"
|
||||
|
||||
CORE_VERSION="$(get_local_version /etc/.pihole)"
|
||||
WEB_VERSION="$(get_local_version /var/www/html/admin)"
|
||||
FTL_VERSION="$(pihole-FTL version)"
|
||||
|
||||
echo "${CORE_VERSION} ${WEB_VERSION} ${FTL_VERSION}" > "/etc/pihole/localversions"
|
||||
|
||||
fi
|
||||
|
|
|
@ -162,6 +162,7 @@ ProcessDNSSettings() {
|
|||
if [[ "${DNSSEC}" == true ]]; then
|
||||
echo "dnssec
|
||||
trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5
|
||||
trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D
|
||||
" >> "${dnsmasqconfig}"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue