Each item on the list is a piece of information stored by configd, sorted by type. Setup indicates information that has been read from a configuration file. State indicates information that represents the actual state of the computer. File indicates stored information as of the last time the configuration file was updated.

Using scutil, you can view data in the keys. First you must get the data, and then you can show the data. For example:

>get State:/Network/Interface/en0/IPv4

>d.show

scutil stores the information from the get command in a local dictionary variable called d. You can also watch or monitor a variable, such that if its state changes, scutil will alert you. To quit the scutil session, enter quit at the prompt.

> quit

You can also manage system configuration parameters from within scutil using the --getand --setoptions. These provide a means of reporting and updating a select group of persistent system preferences, including ComputerName, LocalHostName, or HostName.

To set the hostname of a system:

$ sudo scutil --set HostName mycomputer.mac.com

ParameterDescription

mycomputer.mac.com

This is the new hostname value you wish to set.

To get the hostname of a system:

$ scutil --get HostName

mycomputer.mac.com

See the scutil man page for more information or enter help at the scutil prompt.

Changing Network Locations

A network location contains all of the network configuration settings for a specific network, such as Ethernet, AirPort, FireWire, or Bluetooth. Each location has a separate set of network settings.

Mobile users who switch between networks have multiple locations set up on their computer and may need to switch between locations quickly. scselect allows you to access these configuration sets or locations.

Chapter 6 Setting Network Preferences

81

Page 81
Image 81
Apple Mac OS X Server manual Changing Network Locations, To set the hostname of a system, To get the hostname of a system