refactor: move cloudflare domain list to dynamic state file
This commit is contained in:
parent
837bafba09
commit
064144134e
3 changed files with 74 additions and 11 deletions
|
|
@ -31,6 +31,26 @@ def cf_list_ddns(config):
|
|||
for domain in mgr.list_domains():
|
||||
click.echo(domain)
|
||||
|
||||
@cloudflare.command(name='add-ddns')
|
||||
@click.argument('domain')
|
||||
@click.pass_obj
|
||||
def cf_add_ddns(config, domain):
|
||||
mgr = CloudflareManager(config)
|
||||
if mgr.add_domain(domain):
|
||||
click.echo(f"Added {domain} to DDNS update list")
|
||||
else:
|
||||
click.echo(f"{domain} already in DDNS update list")
|
||||
|
||||
@cloudflare.command(name='remove-ddns')
|
||||
@click.argument('domain')
|
||||
@click.pass_obj
|
||||
def cf_remove_ddns(config, domain):
|
||||
mgr = CloudflareManager(config)
|
||||
if mgr.remove_domain(domain):
|
||||
click.echo(f"Removed {domain} from DDNS update list")
|
||||
else:
|
||||
click.echo(f"{domain} not found in DDNS update list")
|
||||
|
||||
@cloudflare.command(name='update-ddns')
|
||||
@click.option('--force', is_flag=True, help='Force update even if IP matches')
|
||||
@click.pass_obj
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue