Add DEBUG environment variable for scripts.

This contains the current debug level used by tinc. Scripts can use it
to decide whether to log debugging information of their own.

Closes #138 on GitHub.
This commit is contained in:
Guus Sliepen 2017-03-21 21:25:27 +01:00
parent 5cbef90620
commit add75303e9

View file

@ -105,6 +105,8 @@ void environment_init(environment_t *env) {
environment_add(env, "DEVICE=%s", device);
if(iface)
environment_add(env, "INTERFACE=%s", iface);
if(debug_level >= 0)
environment_add(env, "DEBUG=%d", debug_level);
}
void environment_exit(environment_t *env) {