@@ -14,7 +14,6 @@
|
|||||||
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
|
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
|
||||||
|
|
||||||
# Other lists we consider safe:
|
# Other lists we consider safe:
|
||||||
http://adblock.gjtech.net/?format=unix-hosts
|
|
||||||
http://mirror1.malwaredomains.com/files/justdomains
|
http://mirror1.malwaredomains.com/files/justdomains
|
||||||
http://sysctl.org/cameleon/hosts
|
http://sysctl.org/cameleon/hosts
|
||||||
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
|
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
|
||||||
|
@@ -11,5 +11,5 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
echo -n "::: Flushing /var/log/pihole.log ..."
|
echo -n "::: Flushing /var/log/pihole.log ..."
|
||||||
truncate -s 0 /var/log/pihole.log
|
echo " " > /var/log/pihole.log
|
||||||
echo "... done!"
|
echo "... done!"
|
||||||
|
@@ -4,7 +4,7 @@ _pihole()
|
|||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
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}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
return 0
|
return 0
|
||||||
|
@@ -21,6 +21,6 @@
|
|||||||
# This will be used for a historical view of your Pi-hole's performance
|
# 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
|
#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
|
# 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
|
||||||
|
@@ -57,7 +57,24 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Compatibility
|
# 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
|
# Fedora Family
|
||||||
if [ -x "$(command -v dnf)" ];then
|
if [ -x "$(command -v dnf)" ];then
|
||||||
PKG_MANAGER="dnf"
|
PKG_MANAGER="dnf"
|
||||||
@@ -77,22 +94,6 @@ if [ -x "$(command -v rpm)" ];then
|
|||||||
package_check() {
|
package_check() {
|
||||||
rpm -qa | grep ^$1- > /dev/null
|
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
|
else
|
||||||
echo "OS distribution not supported"
|
echo "OS distribution not supported"
|
||||||
exit
|
exit
|
||||||
|
10
pihole
10
pihole
@@ -72,7 +72,15 @@ function setupLCDFunction {
|
|||||||
|
|
||||||
function queryFunc {
|
function queryFunc {
|
||||||
domain=$2
|
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
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user