04.06.2013 Views

UCS 2.4 - Univention

UCS 2.4 - Univention

UCS 2.4 - Univention

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

sshd/permitroot: yes<br />

sshd/xforwarding: yes<br />

14.3 Using variables in shell scripts<br />

Regular expressions can be used when searching for <strong>Univention</strong> Configuration Registry variables in order<br />

only to display variables which correspond to a predetermined search template. <strong>Univention</strong> Configuration<br />

Registry supports all regular expressions which are supported by the python module re. An extensive<br />

explanation of the syntax can be found in the documentation of the re module. It can also be displayed<br />

with the command pydoc re in the command line on <strong>UCS</strong> systems. The following gives some examples:<br />

• Search for all <strong>Univention</strong> Configuration Registry variables which begin with ’ldap’ or ’ssl’:<br />

univention-config-registry search ’^(ldap|ssl)’<br />

• Search for all <strong>Univention</strong> Configuration Registry variables which include ’ssl’ or ’ssh’:<br />

univention-config-registry search ’ss(l|h)’<br />

• Search for all <strong>Univention</strong> Configuration Registry variables with a current value composed of the<br />

string ’mail’, any character string and the string ’Address’. The asterisk (*) is used to determine that<br />

preceding characters should occur never, once or more than once. To use the asterisk for different<br />

characters as in the bash shell, it must be used in combination with the full stop (.) as a wildcard for<br />

an alphanumeric character.<br />

univention-config-registry search --value ’mail.*Address’<br />

Individual <strong>Univention</strong> Configuration Registry variables can be displayed with the parameter get. Unlike the<br />

parameters dump and search only the current value of the <strong>Univention</strong> Configuration Registry variable is<br />

shown here without variable names.<br />

# univention-config-registry get ldap/server/name<br />

master.firma.de<br />

# univention-config-registry get ldap/server/ip<br />

192.168.0.2<br />

14.3 Using variables in shell scripts<br />

The parameter shell is used to display <strong>Univention</strong> Configuration Registry variables and their current as-<br />

signments in a format that can be used in shell scripts.<br />

univention-config-registry shell<br />

This command displays the values of all <strong>Univention</strong> Configuration Registry variables as a pair per line as<br />

variablenname="wert"<br />

Different conversions are involved in this: forward slashes in variable names are replaced with underscores<br />

and characters in the values which have a particular significance in shell scripts are included in quotation<br />

marks to ensure they are not altered.<br />

Individual values can be displayed when the shell parameter is expanded with the desired variable name:<br />

univention-config-registry shell ldap/server/name<br />

279

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

Saved successfully!

Ooh no, something went wrong!