mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-02-26 21:18:18 +00:00
dan dropped a line = line.rstrip()
, not to worry, I picked it up for him.
This commit is contained in:
parent
14fc90579d
commit
cc3fe5363a
1 changed files with 2 additions and 1 deletions
|
@ -47,7 +47,7 @@ import sqlite3
|
|||
logfile = '/etc/pihole/pihole.2.eventHorizon.txt'
|
||||
|
||||
# Create the SQLite connection
|
||||
conn = sqlite3.connect('/etc/pihole/pihole.db')
|
||||
conn = sqlite3.connect('/etc/pihole/gravity.db')
|
||||
|
||||
# Python auto-handle commits, no need to call for commits manually
|
||||
with conn:
|
||||
|
@ -71,5 +71,6 @@ with conn:
|
|||
# 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,))
|
||||
|
|
Loading…
Add table
Reference in a new issue