Updated now based on timestamp

Did I forget to add feed_asn.py a few commits ago?
Oh well...
This commit is contained in:
Geoffrey Frogeye 2019-12-13 13:54:00 +01:00
parent 8d94b80fd0
commit f3eedcba22
Signed by: geoffrey
GPG key ID: D8A7ECA00A8CD3DD
4 changed files with 69 additions and 27 deletions

View file

@ -28,6 +28,7 @@ if __name__ == '__main__':
# split = line.split(b'"')
split = line.split('"')
try:
updated = int(split[3])
name = split[7]
dtype = split[11]
value = split[15]
@ -43,13 +44,13 @@ if __name__ == '__main__':
DB.enter_step('feed_switch')
if dtype == 'a':
for rule in DB.get_ip4(value):
DB.set_hostname(name, source=rule)
DB.set_hostname(name, source=rule, updated=updated)
elif dtype == 'cname':
for rule in DB.get_domain(value):
DB.set_hostname(name, source=rule)
DB.set_hostname(name, source=rule, updated=updated)
elif dtype == 'ptr':
for rule in DB.get_domain(value):
DB.set_ip4address(name, source=rule)
DB.set_ip4address(name, source=rule, updated=updated)
DB.enter_step('iowait')
except KeyboardInterrupt:
log.warning("Interupted.")