Miscellaneous administrivia that might be useful
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
428 B

import csv, sys
rdr = csv.reader(sys.stdin)
D_MAC, D_NAME = 0, 1
ADDR_FORM = '128.153.144.{}'
BIAS = 40
for row in rdr:
mac, name = map(lambda i: row[i], (D_MAC, D_NAME))
if name.lower().startswith('itl'):
_, _, rest = name.partition('-')
rest = int(rest)
addr = ADDR_FORM.format(rest + BIAS)
print(f'host {name}.cslabs.clarkson.edu {{ hardware ethernet {mac}; fixed-address {addr}; }}')