Backend usage

Scripts and options

config-wrapper

The config-wrapper.pl script is used to initialize a transaction, set and get variables values, and commit the transaction. It is also used to perform a backup of the configuration file, and restore it (and update the whole system in the process, triggering all events).

config-wrapper.pl usage:


config-wrapper.pl transaction_name <-i | -g | -m | -s | -la | -ld | -a | -c> 
config-wrapper.pl <--backup | --restore | --help | --version>

  * Transactions operations:

  -i --init      Initialize the transaction
  -g --get       Prints one variable content or all variable definitions/values
                 e.g. --get <parameter-name> [<arguments>]
                      --get all (or --get)
  -m --mget      Prints multiple variables content in a comma separated string
                 (only with normal variables, not with proxy variables)
                 e.g. --mget <param1> <param2> ...
  -s --set       Sets a variable
                 e.g. --set <param1> <arg1> [<arg2> <arg3> ...]
		 You can use multiple -s options on the same command line
		 e.g. --set <param1> <arg1> [<arg2>...] --set <param2> <arg2> ...
  -la --listadd  Add an element to a list-type variable: var=item1,item2,...
                 An element can have attributes: item1 (attr1=value1 attr2=value2 ...),item2 ...
                 e.g. --listadd <param> <item> [<attr1> <value1> <attr2> <value2> ...]
  -ld --listdel  Del an element from a list-type variable
                 If one or several attributes are given, only these attributes will be removed and 
                 not the element itself.
                 e.g. --listdel <param> <item> [<attr1> <attr2> ...]
  -a --abort     Abort the transaction
  -c --commit    Commit the transaction 
                 (apply changes on the master configuration)
                 Returns an error if configuration has changed during 
                 the transaction.
  -f --force     Commit the transaction without any check.

  * Backup and restore operations:

  -b --backup    Backup the configuration file
                 e.g. --backup 
                      --backup <destination_filename_with_path>
  -r --restore   Restore system configuration
                 e.g. --restore
                      --restore <config_backup_filename_with_path>
  -u --update    Update the whole system by triggering *all* events
                 (i.e. apply all configuration values)     
  -h --help      Prints this page to standard output.
  -v --version   Prints version information to standard output.

config-test

The config-test.pl script is used to test a variable state or value.

config-test.pl usage:

config-test.pl transaction_name variable_name [pattern]
# Matching exit codes:
# 0: variable does not match any pattern, or no pattern was given, 
#    but the variable is not empty
# 1: the first pattern matched
# 2: the second pattern matched
# and so on...

# Error exit codes:
# -1 (255): variable exists but is empty
# -2 (254): variable does not exist
# -3 (253): 'parachute' exit

Usage examples