04.06.2013 Views

UCS 2.4 - Univention

UCS 2.4 - Univention

UCS 2.4 - Univention

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

14.5 Creating new <strong>Univention</strong> Configuration Registry variables<br />

14.5 Creating new <strong>Univention</strong> Configuration Registry variables<br />

A new variable can be registered with univention-config-registry and the parameter set. The<br />

variable can be given any name consisting exclusively of lowercase letters, full stops, figures, hyphens<br />

and forward slashes. If the newly created <strong>Univention</strong> Configuration Registry variable is to be automatically<br />

used in configuration files it should be registered (see Chapter 14.7).<br />

# univention-config-registry set test/variable=neu<br />

Create test/variable<br />

A conditional setting of variables is also possible. For example, if a value should only be saved in a<br />

<strong>Univention</strong> Configuration Registry variable when the variable is empty, this can be done by entering a<br />

question mark instead of the equals sign when assigning values.<br />

univention-config-registry set dns/forwarder1?192.168.0.2<br />

In this example, the variable dns/forwarder1 is only set to the value 192.168.0.2 when it was previously<br />

empty. When the variable already contains a value, this is not changed.<br />

When setting and changing <strong>Univention</strong> Configuration Registry variables, numerous variables can be en-<br />

tered in one execution.<br />

14.6 Deleting <strong>Univention</strong> Configuration Registry variables<br />

The parameter unset is used to delete a variable. The following example deletes the variable dns/for-<br />

warder2. It is also possible here to specify several variables to be deleted.<br />

univention-config-registry unset dns/forwarder2<br />

When deleting a variable, univention-config-registry displays which files are affected by the change and<br />

rewritten.<br />

14.7 Registering <strong>Univention</strong> Configuration Registry variables<br />

The <strong>Univention</strong> Configuration Registry system guarantees the regeneration of the configuration files for<br />

which a variable is registered when a change is made to this variable. This is done using <strong>Univention</strong><br />

Configuration Registry templates. Essentially, a <strong>Univention</strong> Configuration Registry template is a copy of<br />

the original configuration file in which the lines in which the value of a <strong>Univention</strong> Configuration Registry<br />

variable are entered are partially replaced with program code.<br />

The <strong>Univention</strong> Configuration Registry variables used in the configuration files are registered in info files<br />

in /etc/univention/templates/info which are named after the package name with the file ending<br />

.info. An example for the package univention-dhcp:<br />

Type: file<br />

File: etc/dhcp3/dhcpd.conf<br />

Variables: ldap/base<br />

Variables: dhcpd/ldap/base<br />

281

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!