deleted: client/clientconf.yaml deleted: client/dnssender.py deleted: client/main.py modified: database/initdb.py deleted: database/test.py deleted: node/main.py deleted: node/nodeconf.yaml deleted: node/proxy.py modified: server/xiaomiandns.py
16 lines
420 B
Python
16 lines
420 B
Python
import sqlite3
|
|
|
|
# 用于创建
|
|
db_file = 'database/dns.db'
|
|
if __name__ == '__main__':
|
|
conn = sqlite3.connect(db_file)
|
|
cursor = conn.cursor()
|
|
try:
|
|
cursor.execute(
|
|
'''CREATE TABLE xiaomiandns(domain TEXT PRIMARY KEY, ip TEXT,timestamp DATETIME)''')
|
|
except sqlite3.OperationalError:
|
|
print("table xiaomiandns already exists")
|
|
conn.commit()
|
|
cursor.close()
|
|
conn.close()
|