mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-03 03:23:19 +00:00
handle importing in pihole command. pihole -i
This commit is contained in:
parent
40750c0196
commit
fcc0a045cc
1 changed files with 13 additions and 1 deletions
14
pihole
14
pihole
|
@ -43,10 +43,21 @@ function debugFunc {
|
|||
}
|
||||
|
||||
function flushFunc {
|
||||
${SUDO} /opt/pihole/piholeLogFlush.sh
|
||||
sqlite3 /etc/pihole/pihole.db "DROP TABLE IF EXISTS queries"
|
||||
sqlite3 /etc/pihole/pihole.db "DROP TABLE IF EXISTS forwards"
|
||||
sqlite3 /etc/pihole/pihole.db "DROP TABLE IF EXISTS replies"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function databaseFunc{
|
||||
echo "::: Importing /var/log/pihole/log to /etc/pihole/pihole.db"
|
||||
python /opt/pihole/dnsmasq_parse.py
|
||||
echo -n "::: Flushing /var/log/pihole.log..."
|
||||
echo " " > /var/log/pihole.log
|
||||
echo " ...done!"
|
||||
exit 1
|
||||
|
||||
}
|
||||
|
||||
function updatePiholeFunc {
|
||||
echo "::: Checking for updates..."
|
||||
|
@ -177,6 +188,7 @@ case "$1" in
|
|||
"-b" | "blacklist" ) blacklistFunc "$@";;
|
||||
"-d" | "debug" ) debugFunc;;
|
||||
"-f" | "flush" ) flushFunc;;
|
||||
"-i" | "importLogToDatabase" ) databaseFunc;;
|
||||
"-up" | "updatePihole" ) updatePiholeFunc;;
|
||||
"-g" | "updateGravity" ) updateGravityFunc "$@";;
|
||||
"-s" | "setupLCD" ) setupLCDFunction;;
|
||||
|
|
Loading…
Reference in a new issue