Thursday, December 3, 2009

Using Text Configuration Files with NetInfo Manager

Using Text Configuration Files with NetInfo Manager

NetInfo Manager, like most NeXT style applications utilizing the columnar data presentation, is clumsy at best for entering information. Only the most stalwart advocate would be caught trying to use it to enter any lengthy lists of data. Fortunately Apple provides an alternative to those used to the elegant simplicity of text configuration files. Here we will populate NetInfo with a hosts listing from a standard BSD hosts file. This is a simple and very practical example.

To see the very specific format NetInfo prefers the hosts file, and to prevent missing any important information, let's export the existing data from Netinfo first. Make sure the resulting file is in /etc/hosts (permissions apply).

nidump hosts local@localhost

Once we've added all the additional entries, we can now reimport the data into NetInfo Manager.

sudo niload -v hosts . < /etc/hosts

For a full overview of command line utility access to NetInfo, execute apropos netinfo and read the corresponding man pages. We are also assuming that the reader is familiar with maintaining standard Unix host files.

No comments: