1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

This adds module-version("examplemod") and using functions in $define,

such as $define ADMIN environment("ADMIN")
This commit is contained in:
Bram Matthys
2026-03-23 17:58:36 +01:00
parent cf101ca114
commit 3521d96f9d
3 changed files with 197 additions and 30 deletions
+18 -11
View File
@@ -9,21 +9,28 @@ This is work in progress and may not always be a stable version.
* New built-in variables `$CONFDIR`, `$DATADIR`, `$LOGDIR`, `$TMPDIR`,
`$DOCDIR`, `$MODULESDIR` and `$MAXCONNECTIONS` are now
available for use in the configuration file.
* New `@if module-exists("modulename")` to check if a module exists on
disk. You can use this with a subsequent `loadmodule` and config items,
this can be handy with 3rd party modules.
* New `@if minimum-version("6.2.4")` to check if the UnrealIRCd version
is at least the specified version.
* New `@if file-exists("filename")` to check if a file exists.
Paths are relative to the conf directory, or absolute if starting
with `/`.
* Variable comparisons now support `>`, `>=`, `<`, `<=` in addition
to `==` and `!=`. Uses natural ordering, so version strings and
numbers compare correctly. Example: `@if $MAXCONNECTIONS >= 1024`.
* New `@if minimum-version("6.2.4")` to check if the UnrealIRCd version
is at least the specified version.
* New `@if module-exists("modulename")` to check if a module exists on
disk. You can use this with a subsequent `loadmodule` and config items,
this can be handy with 3rd party modules.
* New `@if module-version("modulename")` to check or compare the
version of a loaded module.
Example: `@if module-version("third/something") >= "2.0"`.
This obviously only works if the module is loaded.
* New `@if file-exists("filename")` to check if a file exists.
Paths are relative to the conf directory, or absolute if starting
with `/`.
* New `@else` support: `@if ... @else ... @endif`.
* New `@if environment("VARNAME")` to check if an OS environment
variable is set. Can also be used with comparison operators, e.g.,
`@if environment("HOME") == "/root"`.
* New `@if environment("VARNAME")` to check if an environment variable
is set. Can also be used with comparison operators, e.g.,
`@if environment("SOMETHING") == "myserver"`.
* `@define` can now use value-returning functions, e.g.,
`@define $ADMIN_EMAIL environment("ADMIN_EMAIL")` to set a
variable from an OS environment variable.
### Changes:
* [GeoIP](https://www.unrealircd.org/docs/GeoIP):