From 3e1f4fb40fb83b9ec67d33882ac15df8d8819a54 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Thu, 6 Oct 2016 10:59:50 +0100 Subject: [PATCH] remove gravity_parse.py and references --- advanced/Scripts/gravity_parse.py | 46 ------------------------------- gravity.sh | 3 -- 2 files changed, 49 deletions(-) delete mode 100644 advanced/Scripts/gravity_parse.py diff --git a/advanced/Scripts/gravity_parse.py b/advanced/Scripts/gravity_parse.py deleted file mode 100644 index 0f4e6ecf..00000000 --- a/advanced/Scripts/gravity_parse.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Pi-hole: A black hole for Internet advertisements -# (c) 2015, 2016 by Jacob Salmela -# Network-wide ad blocking via your Raspberry Pi -# http://pi-hole.net -# Controller for all pihole scripts and functions. -# -# Pi-hole is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. - -import sqlite3 - -# Logfile containing unique list of all domains on downloaded lists. -logfile = '/etc/pihole/pihole.2.eventHorizon.txt' - -# Create the SQLite connection -conn = sqlite3.connect('/etc/pihole/pihole.db') - -# Python auto-handle commits, no need to call for commits manually -with conn: - c = conn.cursor() - - # enable WAL mode - c.execute('PRAGMA journal_mode=WAL;') - - # Lists have just been downloaded, clear out the existing data - c.execute('DROP TABLE IF EXISTS gravity') - - # Ready new table for list of domains - gt = ''' - CREATE TABLE IF NOT EXISTS gravity ( - domain text - ) - ''' - c.execute(gt) - - # Parse the log file into the database - with open(logfile) as f: - for line in f: - line = line.rstrip() - sql = "INSERT INTO gravity (domain) VALUES (?)" - c.execute(sql, (line,)) diff --git a/gravity.sh b/gravity.sh index d8651fcd..1cc55321 100755 --- a/gravity.sh +++ b/gravity.sh @@ -241,9 +241,6 @@ function gravity_unique() { echo " done!" numberOf=$(wc -l < ${piholeDir}/${eventHorizon}) echo "::: $numberOf unique domains trapped in the event horizon." - - echo -n "::: Importing domains into database for web admin lookups..." - python /opt/pihole/gravity_parse.py echo " done!"