Changeset 10069 in genesis
- Timestamp:
- Mar 9, 2012, 8:56:40 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10067 r10069 63 63 'rc.conf.local', 64 64 'resolv.conf', 65 'motd', 65 66 'wleiden.yaml', 66 67 ] … … 383 384 output += "\n" 384 385 for iface,addrs in sorted(addrs_list.iteritems()): 385 for addr,comment in addrs: 386 for addr, comment in addrs: 387 ifacedump['iface'] = iface 386 388 output += "# %s || %s || %s\n" % (iface, addr, comment) 387 389 output += "ipv4_addrs_%s='%s'\n\n" % (iface_map[iface], " ".join([x[0] for x in addrs])) … … 482 484 return output 483 485 486 def generate_motd(datadump): 487 """ Generate configuration file '/etc/motd' """ 488 output = """\ 489 FreeBSD 9.0-RELEASE (kernel.wleiden) #0 r230587: Sun Jan 29 17:09:57 CET 2012 490 491 WWW: %(autogen_fqdn)s.wleiden.net - http://www.wirelessleiden.nl 492 493 Interlinks: 494 """ % datadump 495 496 # XXX: This is a hacky way to get the required data 497 for line in generate_rc_conf_local(datadump).split('\n'): 498 if '||' in line and not line[1:].split()[0] in ['lo0', 'ath0'] : 499 output += " - %s \n" % line[1:] 500 output += """\ 501 Attached bridges: 502 """ 503 for iface_key in datadump['autogen_iface_keys']: 504 ifacedump = datadump[iface_key] 505 if ifacedump.has_key('ns_ip'): 506 output += " - %(interface)s || %(mode)s || %(ns_ip)s\n" % ifacedump 507 508 return output 484 509 485 510 … … 567 592 elif config == 'resolv.conf': 568 593 output += generate_resolv_conf(datadump_extra) 594 elif config == 'motd': 595 output += generate_motd(datadump_extra) 569 596 else: 570 597 assert False, "Config not found!"
Note:
See TracChangeset
for help on using the changeset viewer.