Next Previous Contents

5. Using the virtual registry

The virtual registry is a general interface to get and set value from various modules in Linuxconf. You can learn more about it by reading the "manual" page for the vregistry module.

We describe here how to use it from a shellmod script.

5.1 vreg_set registry_variable_name value

You can set any variable by issuing the vreg_set command. The variable name is one registry variable. You can learn the about the available variable by running /sbin/vregistry --list.

You generally issue several vreg_set statements and then you call the vreg_do function to commit the request. The various modules are updated at this time only.

5.2 vreg_get registry_variable_name shell-variable

This will collect the value of the registry variable into a local variable of the shell named shell-variable.

You generally issue several vreg_get statements and then you call the vreg_do function to commit the request. After having called vreg_do, your shell variables are properly assigned.

        qecho vreg_get samba.workgroup workgroup
        qecho vreg_get samba.winsserver wins
        # At this point, neither workgroup or wins are assigned
        vreg_do
        qecho notice "Your workgroup is $workgroup, wins server, $wins"
        

5.3 vreg_do

vreg_do is a shell function. so you use it directly unlike most other shellmod command which are "echoed". vreg_do acts like the dispatch command. It requests action and grab the results.


Next Previous Contents