diff --git a/advanced/Scripts/chronometer.sh b/advanced/Scripts/chronometer.sh index 93b0cbb1..3dce9c3e 100755 --- a/advanced/Scripts/chronometer.sh +++ b/advanced/Scripts/chronometer.sh @@ -22,7 +22,7 @@ function GetJSONValue { retVal=$(echo $1 | sed 's/\\\\\//\//g' | \ sed 's/[{}]//g' | \ awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | \ - sed 's/\"\:\"/\|/g' | \ + sed 's/\"\:/\|/g' | \ sed 's/[\,]/ /g' | \ sed 's/\"//g' | \ grep -w $2) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index df71e9a9..32fb712b 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -105,21 +105,21 @@ GitCheckUpdateAvail() { # defaults to the current one. REMOTE="$(git rev-parse @{upstream})" - # Change back to original directory - cd "${curdir}" - if [[ ${#LOCAL} == 0 ]]; then - echo "::: Error: Local revision could not be optained, ask Pi-hole support." + echo "::: Error: Local revision could not be obtained, ask Pi-hole support." echo "::: Additional debugging output:" git status exit fi if [[ ${#REMOTE} == 0 ]]; then - echo "::: Error: Remote revision could not be optained, ask Pi-hole support." + echo "::: Error: Remote revision could not be obtained, ask Pi-hole support." echo "::: Additional debugging output:" git status exit fi + + # Change back to original directory + cd "${curdir}" if [[ "${LOCAL}" != "${REMOTE}" ]]; then # Local branch is behind remote branch -> Update diff --git a/gravity.sh b/gravity.sh index b1cd57a6..31bc6bd0 100755 --- a/gravity.sh +++ b/gravity.sh @@ -32,6 +32,7 @@ adListDefault=/etc/pihole/adlists.default whitelistScript="pihole -w" whitelistFile=/etc/pihole/whitelist.txt blacklistFile=/etc/pihole/blacklist.txt +readonly wildcardlist="/etc/dnsmasq.d/03-pihole-wildcard.conf" #Source the setupVars from install script for the IP setupVars=/etc/pihole/setupVars.conf @@ -235,6 +236,21 @@ gravity_Blacklist() { } +gravity_Wildcard() { + # Return number of wildcards in output - don't actually handle wildcards + if [[ -f "${wildcardlist}" ]]; then + num=$(grep -c ^ "${wildcardlist}") + if [[ -n "${IPV4_ADDRESS}" && -n "${IPV6_ADDRESS}" ]];then + let num/=2 + fi + plural=; [[ "$num" != "1" ]] && plural=s + echo "::: Wildcard blocked domain${plural}: $numBlacklisted" + else + echo "::: No wildcards used!" + fi + +} + gravity_Whitelist() { #${piholeDir}/${eventHorizon}) echo ":::" @@ -401,6 +417,7 @@ else fi gravity_Whitelist gravity_Blacklist +gravity_Wildcard gravity_hostFormat gravity_blackbody