This commit is contained in:
mortzu 2015-01-16 16:13:32 +01:00
commit f7e2ae8fba
2 changed files with 6 additions and 6 deletions

View File

@ -12,7 +12,7 @@ def str_to_domainlabel(s):
label = re.sub("^-*", "", label)
label = re.sub("-*$", "", label)
if not re.match("^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$", label):
if not re.match("^[a-zA-Z][a-zA-Z0-9-]{,61}[a-zA-Z0-9]$", label):
raise RuntimeError("Not convertable to a domain label: %s" % s)
return label
@ -40,7 +40,7 @@ if not domain.endswith("."):
domain = domain + "."
print("""$TTL 1h
@ IN SOA ns.ffhb. liste.bremen.freifunk.net. (
@ IN SOA vpn01.bremen.freifunk.net. noc.bremen.freifunk.net. (
%s ; serial
1h ; refresh
30m ; retry
@ -48,7 +48,7 @@ print("""$TTL 1h
1h ; caching
)
@ NS ns01.ffhb.
NS vpn01.bremen.freifunk.net.
""" % datetime.now().strftime("%Y%m%d%H%M"))
for node in data.values():

View File

@ -12,7 +12,7 @@ def str_to_domainlabel(s):
label = re.sub("^-*", "", label)
label = re.sub("-*$", "", label)
if not re.match("^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$", label):
if not re.match("^[a-zA-Z][a-zA-Z0-9-]{,61}[a-zA-Z0-9]$", label):
raise RuntimeError("Not convertable to a domain label: %s" % s)
return label
@ -20,7 +20,7 @@ def str_to_domainlabel(s):
data = json.load(sys.stdin)
print """$TTL 1h
@ IN SOA ns.ffhb. liste.bremen.freifunk.net. (
@ IN SOA vpn01.bremen.freifunk.net. noc.bremen.freifunk.net. (
%s ; serial
1h ; refresh
30m ; retry
@ -28,7 +28,7 @@ print """$TTL 1h
1h ; caching
)
NS ns.ffhb.
NS vpn01.bremen.freifunk.net.
""" % datetime.now().strftime("%Y%m%d%H%M")