diff --git a/adlists.default b/adlists.default index 2c171e87..5a803400 100644 --- a/adlists.default +++ b/adlists.default @@ -14,7 +14,6 @@ https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts # Other lists we consider safe: -http://adblock.gjtech.net/?format=unix-hosts http://mirror1.malwaredomains.com/files/justdomains http://sysctl.org/cameleon/hosts https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist diff --git a/advanced/Scripts/piholeLogFlush.sh b/advanced/Scripts/piholeLogFlush.sh index db97f8cb..8b16e3d5 100755 --- a/advanced/Scripts/piholeLogFlush.sh +++ b/advanced/Scripts/piholeLogFlush.sh @@ -11,5 +11,5 @@ # (at your option) any later version. echo -n "::: Flushing /var/log/pihole.log ..." -truncate -s 0 /var/log/pihole.log +echo " " > /var/log/pihole.log echo "... done!" diff --git a/advanced/bash-completion/pihole b/advanced/bash-completion/pihole index e2c70558..2d6aafae 100644 --- a/advanced/bash-completion/pihole +++ b/advanced/bash-completion/pihole @@ -4,7 +4,7 @@ _pihole() COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" - opts="whitelist blacklist debug flush updateDashboard updateGravity setupLCD chronometer uninstall help" + opts="blacklist chronometer debug flush help query setupLCD uninstall updateDashboard updateGravity updatePihole version whitelist" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 diff --git a/advanced/pihole.cron b/advanced/pihole.cron index 712679ac..d4ec56a7 100644 --- a/advanced/pihole.cron +++ b/advanced/pihole.cron @@ -21,6 +21,6 @@ # This will be used for a historical view of your Pi-hole's performance #50 23 * * * root /usr/local/bin/dailyLog.sh # note: this is outdated -# Pi-hole: Flush the log daily at 11:58 so it doesn't get out of control +# Pi-hole: Flush the log daily at 00:00 so it doesn't get out of control # Stats will be viewable in the Web interface thanks to the cron job above -58 23 * * * root /usr/local/bin/pihole flush +00 00 * * * root /usr/local/bin/pihole flush diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 32a80307..97171c31 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -57,7 +57,24 @@ else fi # Compatibility -if [ -x "$(command -v rpm)" ];then + +if [ -x "$(command -v apt-get)" ];then + # Debian Family + PKG_MANAGER="apt-get" + PKG_CACHE="/var/cache/apt" + UPDATE_PKG_CACHE="$PKG_MANAGER -qq update" + PKG_UPDATE="$PKG_MANAGER upgrade" + PKG_INSTALL="$PKG_MANAGER --yes --quiet install" + PKG_COUNT="$PKG_MANAGER -s -o Debug::NoLocking=true upgrade | grep -c ^Inst" + INSTALLER_DEPS=( apt-utils whiptail dhcpcd5) + PIHOLE_DEPS=( dnsutils bc dnsmasq lighttpd php5-common php5-cgi php5 git curl unzip wget sudo netcat cron ) + LIGHTTPD_USER="www-data" + LIGHTTPD_GROUP="www-data" + LIGHTTPD_CFG="lighttpd.conf.debian" + package_check() { + dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed" + } +elif [ -x "$(command -v rpm)" ];then # Fedora Family if [ -x "$(command -v dnf)" ];then PKG_MANAGER="dnf" @@ -77,22 +94,6 @@ if [ -x "$(command -v rpm)" ];then package_check() { rpm -qa | grep ^$1- > /dev/null } -elif [ -x "$(command -v apt-get)" ];then - # Debian Family - PKG_MANAGER="apt-get" - PKG_CACHE="/var/cache/apt" - UPDATE_PKG_CACHE="$PKG_MANAGER -qq update" - PKG_UPDATE="$PKG_MANAGER upgrade" - PKG_INSTALL="$PKG_MANAGER --yes --quiet install" - PKG_COUNT="$PKG_MANAGER -s -o Debug::NoLocking=true upgrade | grep -c ^Inst" - INSTALLER_DEPS=( apt-utils whiptail dhcpcd5) - PIHOLE_DEPS=( dnsutils bc dnsmasq lighttpd php5-common php5-cgi php5 git curl unzip wget sudo netcat ) - LIGHTTPD_USER="www-data" - LIGHTTPD_GROUP="www-data" - LIGHTTPD_CFG="lighttpd.conf.debian" - package_check() { - dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed" - } else echo "OS distribution not supported" exit diff --git a/pihole b/pihole index 29f8821b..bd948b55 100755 --- a/pihole +++ b/pihole @@ -72,7 +72,15 @@ function setupLCDFunction { function queryFunc { domain=$2 - for list in /etc/pihole/list.*;do echo $list;grep ${domain} $list;done + for list in /etc/pihole/list.* + do + count=$(grep ${domain} $list | wc -l) + echo "::: ${list} (${count} results)" + if [[ ${count} > 0 ]]; then + grep ${domain} ${list} + fi + echo "" + done exit 1 }