C.2. Configuration Files

 < Day Day Up > 

Setting the environment variables for every shell can be troublesome, so rt provides a simpler way: configuration files. These configuration files are simple and consist of a small set of keywords and their values:

     server https://rt.example.com     user jdoe 

The keys for the configuration file are similar to the environment variables, but they don't have the RT prefix and they're all lowercase. The configuration file doesn't have keys equivalent to the RTDEBUG or RTCONFIG environment variables. The available settings are as follows:

server URL
user username
query querystring
orderby order

If the environment variable RTCONFIG is not set, rt first looks for a configuration file with the name .rtrc in the current directory. If that file doesn't exist, rt searches for .rtrc in all parent directories up to the root directory, then in the user's home directory, and finally looks at /etc/rt.conf. If rt is still missing the required server, user, and password information after searching for configuration files and inspecting the environment variables, it considers it a fatal error and forcibly quits.

The following example is a complete rt configuration file. Note that lines prefixed with the pound # sign are ignored, as are blank lines.

     # This is a sample configuration file     user      rtuser     server    http://support.example.com     passwd    secret     query     "Status = 'new' and Priority > 5" 

At this point, using either the environment variables, the configuration file method, or some combination of both, you should be able to setup rt to access any functional RT server at your disposal.

     < Day Day Up > 

    RT Essentials
    RT Essentials
    ISBN: 0596006683
    EAN: 2147483647
    Year: 2005
    Pages: 166

    Similar book on Amazon

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net