Small fixes

This commit is contained in:
rune 2023-03-22 12:28:14 +01:00
parent 5f675974cb
commit f543eea7e5

View File

@ -234,7 +234,7 @@ def list_sub_domains(domain):
print("[red]Error: [/red]No such domain. Check spelling or use ddns -d to show all top domains.") print("[red]Error: [/red]No such domain. Check spelling or use ddns -d to show all top domains.")
else: else:
print('\n\nCurrent sub domains for [b]%s[/b]' % (domain)) print('\n\nCurrent sub domains for [b]%s[/b]' % (domain))
print('=====================================================================') print('===============================================================================================')
cursor.execute('SELECT id FROM domains WHERE name LIKE ?', (domain,)) cursor.execute('SELECT id FROM domains WHERE name LIKE ?', (domain,))
topdomain_id = cursor.fetchone()[0] topdomain_id = cursor.fetchone()[0]
cursor.execute('SELECT COUNT(*) FROM subdomains WHERE main_id LIKE ?',(topdomain_id,)) cursor.execute('SELECT COUNT(*) FROM subdomains WHERE main_id LIKE ?',(topdomain_id,))
@ -242,12 +242,12 @@ def list_sub_domains(domain):
if count == 0: if count == 0:
print('[red]Error:[/red] No sub domains for [b]%s[/b]' % (domain)) print('[red]Error:[/red] No sub domains for [b]%s[/b]' % (domain))
else: else:
cursor.execute('SELECT name,last_updated FROM subdomains WHERE main_id LIKE ?',(topdomain_id,) ) cursor.execute('SELECT name,last_updated,last_checked FROM subdomains WHERE main_id LIKE ?',(topdomain_id,) )
subdomains = cursor.fetchall() subdomains = cursor.fetchall()
for i in subdomains: for i in subdomains:
topdomain = i[0]+'.'+domain topdomain = i[0]+'.'+domain
topdomain = "{:<25}".format(topdomain) topdomain = "{:<25}".format(topdomain)
print(topdomain+'\tLast updated : '+i[1]) print(topdomain+'\tUpdated : '+i[1]+'\tChecked : '+i[2])
print('\n') print('\n')