Two command line tools have been created to make it easier to manage server configurations and user repositories.
Configuration tool allows to look at configuration settings and modify parameters. It takes care of proper parameters types and encoding.
Repository management tool allows to print repository content for all or for selected users. Modify repository data, add, delete users and copy data from one repository to another.
This guide describe how to efficiently use command line tools which are available for user repository and configuration management.
These 2 command line tools for managing configuration and repository are:
Both scripts call class from Tigase package. If you run any of those script with -h parameter you will get help screen describing all available parameters.
I will not concentrate on that help information which is easily accessible anyway. This guide will focus on particular use cases. So it will answer the question: "How to do use the tool?".
The configuration tool allows a user to look at configuration settings and modify parameters.
First, an answer to the question: "Why use this configuration tool instead of directly, manually editing the config file?"
There are a couple of reasons why you should NOT manually edit configuration file and use the tool instead to modify settings:
First thing you can do is running the script with -h parameter:
In response you get description of all available parameters:
Parameters: -h this help message -c file configuration file -key key node/key for the value to set -value value value to set in configuration file -set set given value for given key -add add given value to the values list for given key -print print content of all configuration settings or of given node/key -f force creation of the new property - dangerous option... Samples: Setting admin account - overwriting any previous value(s) $ ./scripts/config.sh -c tigase-config.xml -print -set -key session_1/admins -value admin1@localhost Adding next admin account leaving old value(s) $ ./scripts/config.sh -c tigase-config.xml -print -add -key session_1/admins -value admin2@localhost Note: adding -print option is useful always, even with -set or -add option as it prints set value afterwards.
Let’s assume configuration for your server is located in tigase-config.xml file. So the first thing you need to set when calling the tool is location of the configuration file.