mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Added yunohost domain dyndns list
command
This commit is contained in:
parent
cf6eaf364d
commit
e4c631c171
3 changed files with 24 additions and 0 deletions
|
@ -620,6 +620,10 @@ domain:
|
|||
extra:
|
||||
pattern: *pattern_password
|
||||
|
||||
### domain_dyndns_list()
|
||||
list:
|
||||
action_help: List all subscribed DynDNS domains
|
||||
|
||||
config:
|
||||
subcategory_help: Domain settings
|
||||
actions:
|
||||
|
|
|
@ -377,6 +377,14 @@ def domain_dyndns_unsubscribe(**kwargs):
|
|||
|
||||
dyndns_unsubscribe(**kwargs)
|
||||
|
||||
def domain_dyndns_list():
|
||||
"""
|
||||
Returns all currently subscribed DynDNS domains
|
||||
"""
|
||||
from yunohost.dyndns import dyndns_list
|
||||
|
||||
return dyndns_list()
|
||||
|
||||
def domain_dyndns_update(**kwargs):
|
||||
"""
|
||||
Update a DynDNS domain
|
||||
|
|
|
@ -236,6 +236,18 @@ def dyndns_unsubscribe(operation_logger, domain, password=None):
|
|||
elif r.status_code == 404: # Invalid domain
|
||||
raise YunohostError("dyndns_unsubscribe_wrong_domain")
|
||||
|
||||
def dyndns_list():
|
||||
"""
|
||||
Returns all currently subscribed DynDNS domains ( deduced from the key files )
|
||||
"""
|
||||
|
||||
files = glob.glob("/etc/yunohost/dyndns/K*key")
|
||||
# Get the domain names
|
||||
for i in range(len(files)):
|
||||
files[i] = files[i].split(".+",1)[0]
|
||||
files[i] = files[i].split("/etc/yunohost/dyndns/K")[1]
|
||||
|
||||
return {"domains":files}
|
||||
|
||||
@is_unit_operation()
|
||||
def dyndns_update(
|
||||
|
|
Loading…
Add table
Reference in a new issue