Changeset 10264 in genesis
- Timestamp:
- Mar 21, 2012, 8:36:02 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10244 r10264 686 686 687 687 688 def make_dns(output_dir = 'dns' ):688 def make_dns(output_dir = 'dns', external = False): 689 689 items = dict() 690 690 … … 809 809 details['serial'] = time.strftime('%Y%m%d%H') 810 810 811 if external: 812 dns_masters = ['siteview.wirelessleiden.nl', 'ns1.vanderzwet.net'] 813 else: 814 dns_masters = ['sunny.wleiden.net'] 815 816 details['master'] = dns_masters[0] 817 details['ns_servers'] = '\n'.join(['\tNS\t%s.' % x for x in dns_masters]) 818 811 819 dns_header = ''' 812 820 $TTL 3h 813 %(zone)s. SOA sunny.wleiden.net. beheer.lijst.wirelessleiden.nl. ( %(serial)s 1d 12h 1w 3h )821 %(zone)s. SOA %(master)s. beheer.lijst.wirelessleiden.nl. ( %(serial)s 1d 12h 1w 3h ) 814 822 ; Serial, Refresh, Retry, Expire, Neg. cache TTL 815 823 816 NS sunny.wleiden.net. 824 %(ns_servers)s 817 825 \n''' 818 826 819 827 820 if not os.path.isdir( 'dns'):821 os.makedirs( 'dns')828 if not os.path.isdir(output_dir): 829 os.makedirs(output_dir) 822 830 details['zone'] = 'wleiden.net' 823 831 f = open(os.path.join(output_dir,"db." + details['zone']), "w") … … 976 984 977 985 elif sys.argv[1] == "dns": 978 make_dns(sys.argv[2] if len(sys.argv) > 2 else 'dns' )986 make_dns(sys.argv[2] if len(sys.argv) > 2 else 'dns', 'external' in sys.argv) 979 987 elif sys.argv[1] == "cleanup": 980 988 # First generate all datadumps
Note:
See TracChangeset
for help on using the changeset viewer.