mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Merge pull request #2750 from pi-hole/release/v4.3
Update Dev with v4.3 fixes
This commit is contained in:
commit
cad9386ff6
8 changed files with 27 additions and 27 deletions
|
@ -70,7 +70,7 @@ Sending a donation using our links below is **extremely helpful** in offsetting
|
||||||
If you'd rather not [donate](https://pi-hole.net/donate/) (_which is okay!_), there are other ways you can help support us:
|
If you'd rather not [donate](https://pi-hole.net/donate/) (_which is okay!_), there are other ways you can help support us:
|
||||||
- [Patreon](https://patreon.com/pihole) _Become a patron for rewards_
|
- [Patreon](https://patreon.com/pihole) _Become a patron for rewards_
|
||||||
- [Digital Ocean](http://www.digitalocean.com/?refcode=344d234950e1) _affiliate link_
|
- [Digital Ocean](http://www.digitalocean.com/?refcode=344d234950e1) _affiliate link_
|
||||||
- [Stickermule](https://www.stickermule.com/unlock?ref_id=6055890701&utm_medium=link&utm_source=invite) _earn a $10 credit after your first purchase_
|
- [Stickermule](https://www.stickermule.com/unlock?ref_id=9127301701&utm_medium=link&utm_source=invite) _earn a $10 credit after your first purchase_
|
||||||
- [Pi-hole Swag Store](https://pi-hole.net/shop/) _affiliate link_
|
- [Pi-hole Swag Store](https://pi-hole.net/shop/) _affiliate link_
|
||||||
- [Amazon](http://www.amazon.com/exec/obidos/redirect-home/pihole09-20) _affiliate link_
|
- [Amazon](http://www.amazon.com/exec/obidos/redirect-home/pihole09-20) _affiliate link_
|
||||||
- [DNS Made Easy](https://cp.dnsmadeeasy.com/u/133706) _affiliate link_
|
- [DNS Made Easy](https://cp.dnsmadeeasy.com/u/133706) _affiliate link_
|
||||||
|
|
|
@ -444,6 +444,9 @@ get_strings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
chronoFunc() {
|
chronoFunc() {
|
||||||
|
local extra_arg="$1"
|
||||||
|
local extra_value="$2"
|
||||||
|
|
||||||
get_init_stats
|
get_init_stats
|
||||||
|
|
||||||
for (( ; ; )); do
|
for (( ; ; )); do
|
||||||
|
@ -461,10 +464,8 @@ chronoFunc() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get refresh number
|
# Get refresh number
|
||||||
if [[ "$*" == *"-r"* ]]; then
|
if [[ "${extra_arg}" = "refresh" ]]; then
|
||||||
num="$*"
|
num="${extra_value}"
|
||||||
num="${num/*-r /}"
|
|
||||||
num="${num/ */}"
|
|
||||||
num_str="Refresh set for every $num seconds"
|
num_str="Refresh set for every $num seconds"
|
||||||
else
|
else
|
||||||
num_str=""
|
num_str=""
|
||||||
|
@ -473,7 +474,7 @@ chronoFunc() {
|
||||||
clear
|
clear
|
||||||
|
|
||||||
# Remove exit message heading on third refresh
|
# Remove exit message heading on third refresh
|
||||||
if [[ "$count" -le 2 ]] && [[ "$*" != *"-e"* ]]; then
|
if [[ "$count" -le 2 ]] && [[ "${extra_arg}" != "exit" ]]; then
|
||||||
echo -e " ${COL_LIGHT_GREEN}Pi-hole Chronometer${COL_NC}
|
echo -e " ${COL_LIGHT_GREEN}Pi-hole Chronometer${COL_NC}
|
||||||
$num_str
|
$num_str
|
||||||
${COL_LIGHT_RED}Press Ctrl-C to exit${COL_NC}
|
${COL_LIGHT_RED}Press Ctrl-C to exit${COL_NC}
|
||||||
|
@ -521,10 +522,10 @@ chronoFunc() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Handle exit/refresh options
|
# Handle exit/refresh options
|
||||||
if [[ "$*" == *"-e"* ]]; then
|
if [[ "${extra_arg}" == "exit" ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
if [[ "$*" == *"-r"* ]]; then
|
if [[ "${extra_arg}" == "refresh" ]]; then
|
||||||
sleep "$num"
|
sleep "$num"
|
||||||
else
|
else
|
||||||
sleep 5
|
sleep 5
|
||||||
|
@ -561,12 +562,10 @@ if [[ $# = 0 ]]; then
|
||||||
chronoFunc
|
chronoFunc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for var in "$@"; do
|
case "$1" in
|
||||||
case "$var" in
|
"-j" | "--json" ) jsonFunc;;
|
||||||
"-j" | "--json" ) jsonFunc;;
|
"-h" | "--help" ) helpFunc;;
|
||||||
"-h" | "--help" ) helpFunc;;
|
"-r" | "--refresh" ) chronoFunc refresh "$2";;
|
||||||
"-r" | "--refresh" ) chronoFunc "$@";;
|
"-e" | "--exit" ) chronoFunc exit;;
|
||||||
"-e" | "--exit" ) chronoFunc "$@";;
|
* ) helpFunc "?";;
|
||||||
* ) helpFunc "?";;
|
esac
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ checkout() {
|
||||||
|
|
||||||
if [[ "${corebranches[*]}" == *"master"* ]]; then
|
if [[ "${corebranches[*]}" == *"master"* ]]; then
|
||||||
echo -e "${OVER} ${TICK} $str"
|
echo -e "${OVER} ${TICK} $str"
|
||||||
echo -e "${INFO} ${#corebranches[@]} branches available for Pi-hole Core"
|
echo -e " ${INFO} ${#corebranches[@]} branches available for Pi-hole Core"
|
||||||
else
|
else
|
||||||
# Print STDERR output from get_available_branches
|
# Print STDERR output from get_available_branches
|
||||||
echo -e "${OVER} ${CROSS} $str\\n\\n${corebranches[*]}"
|
echo -e "${OVER} ${CROSS} $str\\n\\n${corebranches[*]}"
|
||||||
|
@ -144,7 +144,7 @@ checkout() {
|
||||||
|
|
||||||
if [[ "${webbranches[*]}" == *"master"* ]]; then
|
if [[ "${webbranches[*]}" == *"master"* ]]; then
|
||||||
echo -e "${OVER} ${TICK} $str"
|
echo -e "${OVER} ${TICK} $str"
|
||||||
echo -e "${INFO} ${#webbranches[@]} branches available for Web Admin"
|
echo -e " ${INFO} ${#webbranches[@]} branches available for Web Admin"
|
||||||
else
|
else
|
||||||
# Print STDERR output from get_available_branches
|
# Print STDERR output from get_available_branches
|
||||||
echo -e "${OVER} ${CROSS} $str\\n\\n${webbranches[*]}"
|
echo -e "${OVER} ${CROSS} $str\\n\\n${webbranches[*]}"
|
||||||
|
|
|
@ -1180,7 +1180,7 @@ upload_to_tricorder() {
|
||||||
# let the user know
|
# let the user know
|
||||||
log_write "${INFO} Debug script running in automated mode"
|
log_write "${INFO} Debug script running in automated mode"
|
||||||
# and then decide again which tool to use to submit it
|
# and then decide again which tool to use to submit it
|
||||||
tricorder_use_nc_or_ssl
|
tricorder_use_nc_or_curl
|
||||||
# If we're not running in automated mode,
|
# If we're not running in automated mode,
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -1189,7 +1189,7 @@ upload_to_tricorder() {
|
||||||
read -r -p "[?] Would you like to upload the log? [y/N] " response
|
read -r -p "[?] Would you like to upload the log? [y/N] " response
|
||||||
case ${response} in
|
case ${response} in
|
||||||
# If they say yes, run our function for uploading the log
|
# If they say yes, run our function for uploading the log
|
||||||
[yY][eE][sS]|[yY]) tricorder_use_nc_or_ssl;;
|
[yY][eE][sS]|[yY]) tricorder_use_nc_or_curl;;
|
||||||
# If they choose no, just exit out of the script
|
# If they choose no, just exit out of the script
|
||||||
*) log_write " * Log will ${COL_GREEN}NOT${COL_NC} be uploaded to tricorder.";exit;
|
*) log_write " * Log will ${COL_GREEN}NOT${COL_NC} be uploaded to tricorder.";exit;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -34,7 +34,7 @@ function get_local_branch() {
|
||||||
function get_local_version() {
|
function get_local_version() {
|
||||||
# Return active branch
|
# Return active branch
|
||||||
cd "${1}" 2> /dev/null || return 1
|
cd "${1}" 2> /dev/null || return 1
|
||||||
git describe --long --dirty --tags || return 1
|
git describe --long --dirty --tags 2> /dev/null || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Source the setupvars config file
|
# Source the setupvars config file
|
||||||
|
|
|
@ -531,7 +531,7 @@ Interfaces:
|
||||||
|
|
||||||
Teleporter() {
|
Teleporter() {
|
||||||
local datetimestamp=$(date "+%Y-%m-%d_%H-%M-%S")
|
local datetimestamp=$(date "+%Y-%m-%d_%H-%M-%S")
|
||||||
php /var/www/html/admin/scripts/pi-hole/php/teleporter.php > "pi-hole-teleporter_${datetimestamp}.zip"
|
php /var/www/html/admin/scripts/pi-hole/php/teleporter.php > "pi-hole-teleporter_${datetimestamp}.tar.gz"
|
||||||
}
|
}
|
||||||
|
|
||||||
addAudit()
|
addAudit()
|
||||||
|
|
|
@ -413,9 +413,10 @@ make_repo() {
|
||||||
rm -rf "${directory}"
|
rm -rf "${directory}"
|
||||||
fi
|
fi
|
||||||
# Clone the repo and return the return code from this command
|
# Clone the repo and return the return code from this command
|
||||||
git clone -q --depth 1 "${remoteRepo}" "${directory}" &> /dev/null || return $?
|
git clone -q --depth 20 "${remoteRepo}" "${directory}" &> /dev/null || return $?
|
||||||
# Data in the repositories is public anyway so we can make it readable by everyone (+r to keep executable permission if already set by git)
|
# Data in the repositories is public anyway so we can make it readable by everyone (+r to keep executable permission if already set by git)
|
||||||
chmod -R a+rX "${directory}"
|
chmod -R a+rX "${directory}"
|
||||||
|
|
||||||
# Show a colored message showing it's status
|
# Show a colored message showing it's status
|
||||||
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
|
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
|
||||||
# Always return 0? Not sure this is correct
|
# Always return 0? Not sure this is correct
|
||||||
|
@ -531,7 +532,7 @@ find_IPv4_information() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Append the CIDR notation to the IP address, if valid_ip fails this should return 127.0.0.1/8
|
# Append the CIDR notation to the IP address, if valid_ip fails this should return 127.0.0.1/8
|
||||||
IPV4_ADDRESS=$(ip -oneline -family inet address show | grep "${IPv4bare}" | awk '{print $4}' | awk 'END {print}')
|
IPV4_ADDRESS=$(ip -oneline -family inet address show | grep "${IPv4bare}/" | awk '{print $4}' | awk 'END {print}')
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get available interfaces that are UP
|
# Get available interfaces that are UP
|
||||||
|
@ -1571,7 +1572,7 @@ update_package_cache() {
|
||||||
else
|
else
|
||||||
# show an error and exit
|
# show an error and exit
|
||||||
printf "%b %b %s\\n" "${OVER}" "${CROSS}" "${str}"
|
printf "%b %b %s\\n" "${OVER}" "${CROSS}" "${str}"
|
||||||
printf " %bError: Unable to update package cache. Please try \"%s\"%b" "${COL_LIGHT_RED}" "${COL_LIGHT_RED}" "${COL_NC}"
|
printf " %bError: Unable to update package cache. Please try \"%s\"%b" "${COL_LIGHT_RED}" "${UPDATE_PKG_CACHE}" "${COL_NC}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -344,7 +344,7 @@ gravity_DownloadBlocklistFromUrl() {
|
||||||
port=443;
|
port=443;
|
||||||
else port=80
|
else port=80
|
||||||
fi
|
fi
|
||||||
bad_list=$(pihole -q -adlist hosts-file.net | head -n1 | awk -F 'Match found in ' '{print $2}')
|
bad_list=$(pihole -q -adlist "${domain}" | head -n1 | awk -F 'Match found in ' '{print $2}')
|
||||||
echo -e "${OVER} ${CROSS} ${str} ${domain} is blocked by ${bad_list%:}. Using DNS on ${PIHOLE_DNS_1} to download ${url}";
|
echo -e "${OVER} ${CROSS} ${str} ${domain} is blocked by ${bad_list%:}. Using DNS on ${PIHOLE_DNS_1} to download ${url}";
|
||||||
echo -ne " ${INFO} ${str} Pending..."
|
echo -ne " ${INFO} ${str} Pending..."
|
||||||
cmd_ext="--resolve $domain:$port:$ip $cmd_ext"
|
cmd_ext="--resolve $domain:$port:$ip $cmd_ext"
|
||||||
|
|
Loading…
Reference in a new issue