Fix cmedb issue

main
mpgn 2022-06-21 05:45:30 -04:00
parent b1d188887b
commit c47c77ce2e
1 changed files with 4 additions and 3 deletions

View File

@ -168,10 +168,11 @@ class database:
cur.execute("INSERT INTO computers (ip, hostname, domain, os, dc) VALUES (?,?,?,?,?)", [ip, hostname, domain, os, dc])
else:
for host in results:
if (hostname != host[2]) or (domain != host[3]) or (os != host[4]) or (smbv1 != host[6]) or (signing != host[7]):
try:
try:
if (hostname != host[2]) or (domain != host[3]) or (os != host[4]) or (smbv1 != host[6]) or (signing != host[7]):
cur.execute("UPDATE computers SET hostname=?, domain=?, os=?, smbv1=?, signing=? WHERE id=?", [hostname, domain, os, smbv1, signing, host[0]])
except:
except:
if (hostname != host[2]) or (domain != host[3]) or (os != host[4]):
cur.execute("UPDATE computers SET hostname=?, domain=?, os=? WHERE id=?", [hostname, domain, os, host[0]])
if dc != None and (dc != host[5]):
cur.execute("UPDATE computers SET dc=? WHERE id=?", [dc, host[0]])