Fixed some small stuff

This commit is contained in:
rune 2023-03-07 19:05:02 +01:00
parent 1cf21ea086
commit 9166b3b1cc

View File

@ -258,7 +258,7 @@ def list_do_sub_domains(domain):
remote = current.read().decode('utf-8') remote = current.read().decode('utf-8')
remoteData = json.loads(remote) remoteData = json.loads(remote)
print('Domains in your DigitalOcean account not in ddns DB for [b]%s[/b]' % (domain)) print('Domains in your DigitalOcean account not in ddns DB for [b]%s[/b]' % (domain))
print('============================================================================') print('===================================================================')
for k in remoteData["domain_records"]: for k in remoteData["domain_records"]:
if k['type'] == 'A': if k['type'] == 'A':
cursor.execute('SELECT COUNT(*) FROM subdomains WHERE id like ?',(str(k['id']),)) cursor.execute('SELECT COUNT(*) FROM subdomains WHERE id like ?',(str(k['id']),))
@ -315,7 +315,8 @@ def show_current_info():
print('Current info.') print('Current info.')
print('==========================================') print('==========================================')
print('API key : %s' % (API)) print('API key : %s' % (API))
print('IP resolver : %s' % (ipserver)) print('IP v4 resolver : %s' % (ipserver))
print('IP v6 resolver : N/A')
print('App version : %s (https://gitlab.pm/rune/ddns)' % (app_version)) print('App version : %s (https://gitlab.pm/rune/ddns)' % (app_version))
print('Top domains : %s' % (topdomains)) print('Top domains : %s' % (topdomains))
print('sub domains : %s' % (subdomains)) print('sub domains : %s' % (subdomains))
@ -451,7 +452,7 @@ parser.add_argument('-k', '--local', help='Add an existing DigitalOcean domain t
parser.add_argument('-r', '--remove', help='Remove a subdomain from your DigitalOcean account and ddns.', parser.add_argument('-r', '--remove', help='Remove a subdomain from your DigitalOcean account and ddns.',
required=False, nargs=1, metavar=('domain'), action='append') required=False, nargs=1, metavar=('domain'), action='append')
parser.add_argument('-i', '--info', help='Show current config info', parser.add_argument('-v', '--version', help='Show current version and config info',
required=False, action='store_true') required=False, action='store_true')
parser.add_argument('-p', '--ipserver', help='Set IP server lookup to use. Indicate 4 or 6 for IP type.', parser.add_argument('-p', '--ipserver', help='Set IP server lookup to use. Indicate 4 or 6 for IP type.',
@ -470,7 +471,7 @@ elif args['top']:
add_domian(args['top'][0][0]) add_domian(args['top'][0][0])
elif args['sub']: elif args['sub']:
add_subdomain(args['sub'][0][0]) add_subdomain(args['sub'][0][0])
elif args['info']: elif args['version']:
show_current_info() show_current_info()
elif args['ipserver']: elif args['ipserver']:
ip_server(args['ipserver'][0][0],args['ipserver'][0][1]) ip_server(args['ipserver'][0][0],args['ipserver'][0][1])