Verified Commit 05d8eb9d authored by Martin Petráček's avatar Martin Petráček
Browse files

config: archive path

parent e8ab2bc7
......@@ -46,7 +46,7 @@ def uci_get_time(opt, default = None):
ret = int(text)
return ret
archive_path = uci_get('pakon.common.archive_path') or '/srv/pakon/pakon-archive.db'
archive_path = uci_get('pakon.archive.path') or '/srv/pakon/pakon-archive.db'
con = sqlite3.connect(archive_path)
con.row_factory = sqlite3.Row
......
......@@ -26,7 +26,7 @@ c.execute('PRAGMA user_version=1')
con.commit()
con.close()
archive_path = uci_get('pakon.common.archive_path') or '/srv/pakon/pakon-archive.db'
archive_path = uci_get('pakon.archive.path') or '/srv/pakon/pakon-archive.db'
os.makedirs(os.path.dirname(os.path.abspath(archive_path)), exist_ok=True)
con = sqlite3.connect(archive_path)
c = con.cursor()
......
......@@ -77,7 +77,7 @@ def is_ignored(hostname):
return False
def query(query):
archive_path = uci_get('pakon.common.archive_path') or '/srv/pakon/pakon-archive.db'
archive_path = uci_get('pakon.archive.path') or '/srv/pakon/pakon-archive.db'
con = sqlite3.connect('/var/lib/pakon.db')
c = con.cursor()
c.execute('ATTACH DATABASE ? AS archive', (archive_path,))
......
......@@ -243,7 +243,7 @@ def reload_replaces(signum, frame):
def main():
global allowed_interfaces, conntrack
archive_path = uci_get('pakon.common.archive_path') or '/srv/pakon/pakon-archive.db'
archive_path = uci_get('pakon.archive.path') or '/srv/pakon/pakon-archive.db'
dns_cache.try_load()
con = sqlite3.connect('/var/lib/pakon.db')
c = con.cursor()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment