#!/usr/bin/perl $subnet = "155.99.214"; $netmask = "255.255.255.0"; $hwfile = "/n/fast/usr/lsrc/flux/doc/dnard/hardware"; open(HWFILE, $hwfile) || die "Could not open hardware file: $!\n"; # Print the header for the group print "\n## Start of autogenerated section\n"; print "subnet ${subnet}.0 netmask ${netmask}{\n"; while () { chomp; s/#.*//; next if (length($_) < 3); ($dnardno, $hwtail) = split; $dnardno += 200; $no = $dnardno - 200; print " host $subnet.$dnardno {\n"; print " hardware ethernet $hwtail;\n"; print " fixed-address $subnet.$dnardno;\n"; print " option host-name \"dnard$no\";\n"; print " }\n"; } # Close the subnet print "\n}\n"; print "## End of autogenerated section\n\n";