5.9 Using the sysconfig Script

The /sbin/sysconfig shell script can be used to set, and to show, the fields in various ttylinux system configuration files; it can set or show any value for any "ITEM=value" line in any configuration file in the /etc/sysconfig and /etc/sysconfig/network-scripts directories.

The following commands sets "ENABLE=yes" and "DHCP=yes" in the /etc/sysconfig/network-scripts/ifcfg-eth0 file.

	sysconfig -nc ifcfg-eth0.enable=yes
	sysconfig -nc ifcfg-eth0.dhcp=yes

The "-nc" option in the above examples tells the sysconfig script to work on files in the /etc/sysconfig/network-scripts directory. The second option is in the form file.item=value.

To change the IP address of the Ethernet network interface, with 192.168.1.100 as the example IP address, with a netmask of 255.255.255.0 and standard subnet gateway and broadcast addresses, use the following sequence of sysconfig script commands.

	sysconfig -nc ifcfg-eth0.ipaddress=192.168.1.100
	sysconfig -nc ifcfg-eth0.network=192.168.1.0
	sysconfig -nc ifcfg-eth0.netmaks=255.255.255.0
	sysconfig -nc ifcfg-eth0.gateway=192.168.1.1
	sysconfig -nc ifcfg-eth0.broadcast=192.168.1.255

Use "-sc" for the first option to the sysconfig script in order to work with system configuration files in the /etc/sysconfig directory.

Use the following command to get complete, up-to-date help description directly from /sbin/sysconfig

	sysconfig --help