2020.10.03-21:08:00

This commit is contained in:
Gerd Zelo 2020-10-03 21:08:00 +02:00
parent a291388a05
commit 031e785233
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Es wurde kein Ausgabeverzeichnis angegeben!"
exit 1
fi
if [ ! -d "$1" ]; then
echo "Ausgabeverzeichnis $1 existiert nicht!"
exit 1
fi
exportFile=$1/TopDomainsBlocked.txt
echo "Exportiere geblocke Doamins ..."
sqlite3 /etc/pihole/pihole-FTL.db "SELECT domain, count(domain) FROM queries WHERE status NOT IN(2,3) GROUP BY domain ORDER BY count(domain) DESC;" >"$exportFile"
echo "Export nach $exportFile abgeschlossen"